repo
stringclasses
195 values
path
stringlengths
4
99
func_name
stringlengths
0
41
original_string
stringlengths
72
56.1k
language
stringclasses
1 value
code
stringlengths
72
56.1k
code_tokens
listlengths
25
8.12k
docstring
stringlengths
2
12.5k
docstring_tokens
listlengths
1
449
sha
stringclasses
197 values
url
stringlengths
88
186
partition
stringclasses
1 value
summary
stringlengths
8
338
input_ids
listlengths
502
502
token_type_ids
listlengths
502
502
attention_mask
listlengths
502
502
labels
listlengths
502
502
SAP/openui5
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
function(bIncludeEntityKey, bIncludeCount, bReturnNoEntities) { if (bIncludeEntityKey != null) { this._bIncludeEntityKey = bIncludeEntityKey; } if (bIncludeCount != null) { this._bIncludeCount = bIncludeCount; } if (bReturnNoEntities != null) { this._bReturnNoEntities = bReturnNoEntities; } }
javascript
function(bIncludeEntityKey, bIncludeCount, bReturnNoEntities) { if (bIncludeEntityKey != null) { this._bIncludeEntityKey = bIncludeEntityKey; } if (bIncludeCount != null) { this._bIncludeCount = bIncludeCount; } if (bReturnNoEntities != null) { this._bReturnNoEntities = bReturnNoEntities; } }
[ "function", "(", "bIncludeEntityKey", ",", "bIncludeCount", ",", "bReturnNoEntities", ")", "{", "if", "(", "bIncludeEntityKey", "!=", "null", ")", "{", "this", ".", "_bIncludeEntityKey", "=", "bIncludeEntityKey", ";", "}", "if", "(", "bIncludeCount", "!=", "null...
Set further options to be applied for the OData request to fetch the query result @param {Boolean} bIncludeEntityKey Indicates whether or not the entity key should be returned for every entry in the query result. Default is not to include it. Pass null to keep current setting. @param {Boolean} bIncludeCount Indicates whether or not the result shall include a count for the returned entities. Default is not to include it. Pass null to keep current setting. @param {Boolean} bReturnNoEntities Indicates whether or not the result shall be empty. This will translate to $top=0 in the OData request and override any setting done with setResultPageBoundaries. The default is not to suppress entities in the result. Pass null to keep current setting. The main use case for this option is to create a request with $inlinecount returning an entity count. @public @function @name sap.ui.model.analytics.odata4analytics.QueryResultRequest#setRequestOptions
[ "Set", "further", "options", "to", "be", "applied", "for", "the", "OData", "request", "to", "fetch", "the", "query", "result" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L4536-L4546
train
Sets the parameters for the filter.
[ 30522, 3853, 1006, 8026, 20464, 12672, 4765, 3012, 14839, 1010, 8026, 20464, 12672, 3597, 16671, 1010, 25626, 14287, 3630, 4765, 6447, 1007, 1063, 2065, 1006, 8026, 20464, 12672, 4765, 3012, 14839, 999, 1027, 19701, 1007, 1063, 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...
adobe/brackets
src/view/ThemeManager.js
extractScrollbars
function extractScrollbars(content) { var scrollbar = []; // Go through and extract out scrollbar customizations so that we can // enable/disable via settings. content = content .replace(scrollbarsRegex, function (match) { scrollbar.push(match); return ""; }); return { content: content, scrollbar: scrollbar }; }
javascript
function extractScrollbars(content) { var scrollbar = []; // Go through and extract out scrollbar customizations so that we can // enable/disable via settings. content = content .replace(scrollbarsRegex, function (match) { scrollbar.push(match); return ""; }); return { content: content, scrollbar: scrollbar }; }
[ "function", "extractScrollbars", "(", "content", ")", "{", "var", "scrollbar", "=", "[", "]", ";", "// Go through and extract out scrollbar customizations so that we can", "// enable/disable via settings.", "content", "=", "content", ".", "replace", "(", "scrollbarsRegex", ...
@private Extracts the scrollbar text from the css/less content so that it can be treated as a separate styling component that can be anabled/disabled independently from the theme. @param {string} content is the css/less input string to be processed @return {{content: string, scrollbar: Array.<string>}} content is the new css/less content with the scrollbar rules extracted out and put in scrollbar
[ "@private", "Extracts", "the", "scrollbar", "text", "from", "the", "css", "/", "less", "content", "so", "that", "it", "can", "be", "treated", "as", "a", "separate", "styling", "component", "that", "can", "be", "anabled", "/", "disabled", "independently", "fr...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/ThemeManager.js#L117-L132
train
Extract scrollbar customizations from content
[ 30522, 3853, 27059, 26775, 14511, 8237, 2015, 1006, 4180, 1007, 1063, 13075, 17186, 8237, 1027, 1031, 1033, 1025, 1013, 1013, 2175, 2083, 1998, 14817, 2041, 17186, 8237, 7661, 22318, 2061, 2008, 2057, 2064, 1013, 1013, 9585, 1013, 4487, 191...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/plugins/listDependencies.js
listDependencies
function listDependencies(deps) { // Extract list of plugins to disable (starting with -) var toRemove = deps .filter(function(plugin) { return !plugin.isEnabled(); }) .map(function(plugin) { return plugin.getName(); }); // Concat with default plugins deps = deps.concat(DEFAULT_PLUGINS); // Remove plugins deps = deps.filterNot(function(plugin) { return toRemove.includes(plugin.getName()); }); // Sort return sortDependencies(deps); }
javascript
function listDependencies(deps) { // Extract list of plugins to disable (starting with -) var toRemove = deps .filter(function(plugin) { return !plugin.isEnabled(); }) .map(function(plugin) { return plugin.getName(); }); // Concat with default plugins deps = deps.concat(DEFAULT_PLUGINS); // Remove plugins deps = deps.filterNot(function(plugin) { return toRemove.includes(plugin.getName()); }); // Sort return sortDependencies(deps); }
[ "function", "listDependencies", "(", "deps", ")", "{", "// Extract list of plugins to disable (starting with -)", "var", "toRemove", "=", "deps", ".", "filter", "(", "function", "(", "plugin", ")", "{", "return", "!", "plugin", ".", "isEnabled", "(", ")", ";", "...
List all dependencies for a book, including default plugins. It returns a concat with default plugins and remove disabled ones. @param {List<PluginDependency>} deps @return {List<PluginDependency>}
[ "List", "all", "dependencies", "for", "a", "book", "including", "default", "plugins", ".", "It", "returns", "a", "concat", "with", "default", "plugins", "and", "remove", "disabled", "ones", "." ]
6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4
https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/plugins/listDependencies.js#L11-L31
train
List all the dependencies
[ 30522, 3853, 2862, 3207, 11837, 4181, 9243, 1006, 2139, 4523, 1007, 1063, 1013, 1013, 14817, 2862, 1997, 13354, 7076, 2000, 4487, 19150, 1006, 3225, 2007, 1011, 1007, 13075, 9538, 5302, 3726, 1027, 2139, 4523, 1012, 11307, 1006, 3853, 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...
apache/incubator-echarts
src/coord/calendar/Calendar.js
function (range) { range = [ this.getDateInfo(range[0]), this.getDateInfo(range[1]) ]; var reversed; if (range[0].time > range[1].time) { reversed = true; range.reverse(); } var allDay = Math.floor(range[1].time / PROXIMATE_ONE_DAY) - Math.floor(range[0].time / PROXIMATE_ONE_DAY) + 1; // Consider case: // Firstly set system timezone as "Time Zone: America/Toronto", // ``` // var first = new Date(1478412000000 - 3600 * 1000 * 2.5); // var second = new Date(1478412000000); // var allDays = Math.floor(second / ONE_DAY) - Math.floor(first / ONE_DAY) + 1; // ``` // will get wrong result because of DST. So we should fix it. var date = new Date(range[0].time); var startDateNum = date.getDate(); var endDateNum = range[1].date.getDate(); date.setDate(startDateNum + allDay - 1); // The bias can not over a month, so just compare date. if (date.getDate() !== endDateNum) { var sign = date.getTime() - range[1].time > 0 ? 1 : -1; while (date.getDate() !== endDateNum && (date.getTime() - range[1].time) * sign > 0) { allDay -= sign; date.setDate(startDateNum + allDay - 1); } } var weeks = Math.floor((allDay + range[0].day + 6) / 7); var nthWeek = reversed ? -weeks + 1 : weeks - 1; reversed && range.reverse(); return { range: [range[0].formatedDate, range[1].formatedDate], start: range[0], end: range[1], allDay: allDay, weeks: weeks, // From 0. nthWeek: nthWeek, fweek: range[0].day, lweek: range[1].day }; }
javascript
function (range) { range = [ this.getDateInfo(range[0]), this.getDateInfo(range[1]) ]; var reversed; if (range[0].time > range[1].time) { reversed = true; range.reverse(); } var allDay = Math.floor(range[1].time / PROXIMATE_ONE_DAY) - Math.floor(range[0].time / PROXIMATE_ONE_DAY) + 1; // Consider case: // Firstly set system timezone as "Time Zone: America/Toronto", // ``` // var first = new Date(1478412000000 - 3600 * 1000 * 2.5); // var second = new Date(1478412000000); // var allDays = Math.floor(second / ONE_DAY) - Math.floor(first / ONE_DAY) + 1; // ``` // will get wrong result because of DST. So we should fix it. var date = new Date(range[0].time); var startDateNum = date.getDate(); var endDateNum = range[1].date.getDate(); date.setDate(startDateNum + allDay - 1); // The bias can not over a month, so just compare date. if (date.getDate() !== endDateNum) { var sign = date.getTime() - range[1].time > 0 ? 1 : -1; while (date.getDate() !== endDateNum && (date.getTime() - range[1].time) * sign > 0) { allDay -= sign; date.setDate(startDateNum + allDay - 1); } } var weeks = Math.floor((allDay + range[0].day + 6) / 7); var nthWeek = reversed ? -weeks + 1 : weeks - 1; reversed && range.reverse(); return { range: [range[0].formatedDate, range[1].formatedDate], start: range[0], end: range[1], allDay: allDay, weeks: weeks, // From 0. nthWeek: nthWeek, fweek: range[0].day, lweek: range[1].day }; }
[ "function", "(", "range", ")", "{", "range", "=", "[", "this", ".", "getDateInfo", "(", "range", "[", "0", "]", ")", ",", "this", ".", "getDateInfo", "(", "range", "[", "1", "]", ")", "]", ";", "var", "reversed", ";", "if", "(", "range", "[", "...
range info @private @param {Array} range range ['2017-01-01', '2017-07-08'] If range[0] > range[1], they will not be reversed. @return {Object} obj
[ "range", "info" ]
4d0ea095dc3929cb6de40c45748826e7999c7aa8
https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/coord/calendar/Calendar.js#L363-L415
train
Get a range of time - zone information
[ 30522, 3853, 1006, 2846, 1007, 1063, 2846, 1027, 1031, 2023, 1012, 2131, 13701, 2378, 14876, 1006, 30524, 1012, 7901, 1006, 1007, 1025, 1065, 13075, 2035, 10259, 1027, 8785, 1012, 2723, 1006, 2846, 1031, 1015, 1033, 1012, 2051, 1013, 4013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
eslint/eslint
lib/rules/space-infix-ops.js
checkConditional
function checkConditional(node) { const nonSpacedConsequesntNode = getFirstNonSpacedToken(node.test, node.consequent, "?"); const nonSpacedAlternateNode = getFirstNonSpacedToken(node.consequent, node.alternate, ":"); if (nonSpacedConsequesntNode) { report(node, nonSpacedConsequesntNode); } else if (nonSpacedAlternateNode) { report(node, nonSpacedAlternateNode); } }
javascript
function checkConditional(node) { const nonSpacedConsequesntNode = getFirstNonSpacedToken(node.test, node.consequent, "?"); const nonSpacedAlternateNode = getFirstNonSpacedToken(node.consequent, node.alternate, ":"); if (nonSpacedConsequesntNode) { report(node, nonSpacedConsequesntNode); } else if (nonSpacedAlternateNode) { report(node, nonSpacedAlternateNode); } }
[ "function", "checkConditional", "(", "node", ")", "{", "const", "nonSpacedConsequesntNode", "=", "getFirstNonSpacedToken", "(", "node", ".", "test", ",", "node", ".", "consequent", ",", "\"?\"", ")", ";", "const", "nonSpacedAlternateNode", "=", "getFirstNonSpacedTok...
Check if the node is conditional @param {ASTNode} node node to evaluate @returns {void} @private
[ "Check", "if", "the", "node", "is", "conditional" ]
bc0819c94aad14f7fad3cbc2338ea15658b0f272
https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/space-infix-ops.js#L125-L134
train
Check if a conditional node is valid
[ 30522, 3853, 4638, 8663, 27064, 1006, 13045, 1007, 1063, 9530, 3367, 2512, 23058, 16409, 5644, 2063, 10997, 3372, 3630, 3207, 1027, 2131, 8873, 12096, 8540, 23058, 11927, 11045, 2078, 1006, 13045, 1012, 3231, 1010, 13045, 1012, 9530, 3366, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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
mxHandle
function mxHandle(state, cursor, image) { this.graph = state.view.graph; this.state = state; this.cursor = (cursor != null) ? cursor : this.cursor; this.image = (image != null) ? image : this.image; this.init(); }
javascript
function mxHandle(state, cursor, image) { this.graph = state.view.graph; this.state = state; this.cursor = (cursor != null) ? cursor : this.cursor; this.image = (image != null) ? image : this.image; this.init(); }
[ "function", "mxHandle", "(", "state", ",", "cursor", ",", "image", ")", "{", "this", ".", "graph", "=", "state", ".", "view", ".", "graph", ";", "this", ".", "state", "=", "state", ";", "this", ".", "cursor", "=", "(", "cursor", "!=", "null", ")", ...
Copyright (c) 2006-2015, JGraph Ltd Copyright (c) 2006-2015, Gaudenz Alder Class: mxHandle Implements a single custom handle for vertices. Constructor: mxHandle Constructs a new handle for the given state. Parameters: state - <mxCellState> of the cell to be handled.
[ "Copyright", "(", "c", ")", "2006", "-", "2015", "JGraph", "Ltd", "Copyright", "(", "c", ")", "2006", "-", "2015", "Gaudenz", "Alder", "Class", ":", "mxHandle" ]
33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44
https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L75211-L75218
train
This is the base implementation of the mxHandle class
[ 30522, 3853, 25630, 11774, 2571, 1006, 2110, 1010, 12731, 25301, 2099, 1010, 3746, 1007, 1063, 2023, 1012, 10629, 1027, 2110, 1012, 3193, 1012, 10629, 1025, 2023, 1012, 2110, 1027, 2110, 1025, 2023, 1012, 12731, 25301, 2099, 1027, 1006, 127...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/modifiers/summary/insertPart.js
insertPart
function insertPart(summary, part, index) { part = SummaryPart(part); var parts = summary.getParts().insert(index, part); return indexLevels(summary.set('parts', parts)); }
javascript
function insertPart(summary, part, index) { part = SummaryPart(part); var parts = summary.getParts().insert(index, part); return indexLevels(summary.set('parts', parts)); }
[ "function", "insertPart", "(", "summary", ",", "part", ",", "index", ")", "{", "part", "=", "SummaryPart", "(", "part", ")", ";", "var", "parts", "=", "summary", ".", "getParts", "(", ")", ".", "insert", "(", "index", ",", "part", ")", ";", "return",...
Returns a new Summary with a part inserted at given index @param {Summary} summary @param {Part} part @param {Number} index @return {Summary}
[ "Returns", "a", "new", "Summary", "with", "a", "part", "inserted", "at", "given", "index" ]
6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4
https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/modifiers/summary/insertPart.js#L12-L17
train
Insert a part into the summary
[ 30522, 3853, 19274, 19362, 2102, 1006, 12654, 1010, 2112, 1010, 5950, 1007, 1063, 2112, 1027, 12654, 19362, 2102, 1006, 2112, 1007, 1025, 13075, 3033, 1027, 12654, 1012, 2131, 26950, 1006, 1007, 1012, 19274, 1006, 5950, 1010, 2112, 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...
TryGhost/Ghost
core/server/data/importer/index.js
function (file) { var self = this, ext = path.extname(file.name).toLowerCase(); return this.isZip(ext) ? self.processZip(file) : self.processFile(file, ext); }
javascript
function (file) { var self = this, ext = path.extname(file.name).toLowerCase(); return this.isZip(ext) ? self.processZip(file) : self.processFile(file, ext); }
[ "function", "(", "file", ")", "{", "var", "self", "=", "this", ",", "ext", "=", "path", ".", "extname", "(", "file", ".", "name", ")", ".", "toLowerCase", "(", ")", ";", "return", "this", ".", "isZip", "(", "ext", ")", "?", "self", ".", "processZ...
Import Step 1: Load the given file into usable importData in the format: {data: {}, images: []}, regardless of whether the file is a single importable file like a JSON file, or a zip file containing loads of files. @param {File} file @returns {Promise}
[ "Import", "Step", "1", ":", "Load", "the", "given", "file", "into", "usable", "importData", "in", "the", "format", ":", "{", "data", ":", "{}", "images", ":", "[]", "}", "regardless", "of", "whether", "the", "file", "is", "a", "single", "importable", "...
bb7bb55cf3e60af99ebbc56099928827b58461bc
https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/data/importer/index.js#L295-L299
train
Process a file
[ 30522, 3853, 1006, 5371, 1007, 1063, 13075, 2969, 1027, 2023, 1010, 4654, 2102, 1027, 4130, 1012, 4654, 2102, 18442, 1006, 5371, 1012, 2171, 1007, 1012, 2000, 27663, 18992, 3366, 1006, 1007, 1025, 2709, 2023, 1012, 2003, 5831, 2361, 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...
wuchangming/spy-debugger
buildin_modules/weinre/web/interfaces/interfaces.js
showInterfaceJavaScript
function showInterfaceJavaScript(intf, html) { html.push("<div class='show-JavaScript'><h3>JavaScript</h3><pre>") var line = "" line += "\n//-----------------------------------------------------------------------------" line += "\n<span class='interfaceName'>class " + intf.name + "</span>" html.push(line) intf.methods.forEach(function(method){ showInterfaceJavaScriptMethod(intf, method, html) }) html.push("</pre></div>") }
javascript
function showInterfaceJavaScript(intf, html) { html.push("<div class='show-JavaScript'><h3>JavaScript</h3><pre>") var line = "" line += "\n//-----------------------------------------------------------------------------" line += "\n<span class='interfaceName'>class " + intf.name + "</span>" html.push(line) intf.methods.forEach(function(method){ showInterfaceJavaScriptMethod(intf, method, html) }) html.push("</pre></div>") }
[ "function", "showInterfaceJavaScript", "(", "intf", ",", "html", ")", "{", "html", ".", "push", "(", "\"<div class='show-JavaScript'><h3>JavaScript</h3><pre>\"", ")", "var", "line", "=", "\"\"", "line", "+=", "\"\\n//-----------------------------------------------------------...
-----------------------------------------------------------------------------
[ "-----------------------------------------------------------------------------" ]
55c1dda0dff0c44920673711656ddfd7ff03c307
https://github.com/wuchangming/spy-debugger/blob/55c1dda0dff0c44920673711656ddfd7ff03c307/buildin_modules/weinre/web/interfaces/interfaces.js#L271-L285
train
showInterfaceJavaScript - Shows the interface s JavaScript
[ 30522, 3853, 2265, 18447, 2121, 12172, 3900, 12044, 23235, 1006, 20014, 2546, 1010, 16129, 1007, 1063, 16129, 1012, 5245, 1006, 1000, 1026, 4487, 2615, 2465, 1027, 1005, 2265, 1011, 9262, 22483, 1005, 1028, 1026, 1044, 2509, 1028, 9262, 224...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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-alert.js
isGlobalThisReferenceOrGlobalWindow
function isGlobalThisReferenceOrGlobalWindow(scope, node) { if (scope.type === "global" && node.type === "ThisExpression") { return true; } if (node.name === "window") { return !isShadowed(scope, node); } return false; }
javascript
function isGlobalThisReferenceOrGlobalWindow(scope, node) { if (scope.type === "global" && node.type === "ThisExpression") { return true; } if (node.name === "window") { return !isShadowed(scope, node); } return false; }
[ "function", "isGlobalThisReferenceOrGlobalWindow", "(", "scope", ",", "node", ")", "{", "if", "(", "scope", ".", "type", "===", "\"global\"", "&&", "node", ".", "type", "===", "\"ThisExpression\"", ")", "{", "return", "true", ";", "}", "if", "(", "node", "...
Checks if the given identifier node is a ThisExpression in the global scope or the global window property. @param {Object} scope The current scope. @param {string} node The identifier node to check @returns {boolean} Whether or not the node is a reference to the global object.
[ "Checks", "if", "the", "given", "identifier", "node", "is", "a", "ThisExpression", "in", "the", "global", "scope", "or", "the", "global", "window", "property", "." ]
bc0819c94aad14f7fad3cbc2338ea15658b0f272
https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-alert.js#L60-L69
train
Check if the node is a global ThisExpression or a global window
[ 30522, 3853, 2003, 23296, 16429, 2389, 15222, 21338, 27235, 24413, 21759, 4135, 10264, 11101, 5004, 1006, 9531, 1010, 13045, 1007, 1063, 2065, 1006, 9531, 1012, 2828, 1027, 1027, 1027, 1000, 3795, 1000, 1004, 1004, 13045, 1012, 2828, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
eslint/eslint
lib/rules/no-self-assign.js
isSameProperty
function isSameProperty(left, right) { if (left.property.type === "Identifier" && left.property.type === right.property.type && left.property.name === right.property.name && left.computed === right.computed ) { return true; } const lname = astUtils.getStaticPropertyName(left); const rname = astUtils.getStaticPropertyName(right); return lname !== null && lname === rname; }
javascript
function isSameProperty(left, right) { if (left.property.type === "Identifier" && left.property.type === right.property.type && left.property.name === right.property.name && left.computed === right.computed ) { return true; } const lname = astUtils.getStaticPropertyName(left); const rname = astUtils.getStaticPropertyName(right); return lname !== null && lname === rname; }
[ "function", "isSameProperty", "(", "left", ",", "right", ")", "{", "if", "(", "left", ".", "property", ".", "type", "===", "\"Identifier\"", "&&", "left", ".", "property", ".", "type", "===", "right", ".", "property", ".", "type", "&&", "left", ".", "p...
Checks whether the property of 2 given member expression nodes are the same property or not. @param {ASTNode} left - A member expression node to check. @param {ASTNode} right - Another member expression node to check. @returns {boolean} `true` if the member expressions have the same property.
[ "Checks", "whether", "the", "property", "of", "2", "given", "member", "expression", "nodes", "are", "the", "same", "property", "or", "not", "." ]
bc0819c94aad14f7fad3cbc2338ea15658b0f272
https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-self-assign.js#L28-L41
train
Returns true if the left and right are the same
[ 30522, 3853, 26354, 14074, 21572, 4842, 3723, 1006, 2187, 1010, 2157, 1007, 1063, 2065, 1006, 2187, 1012, 3200, 1012, 2828, 1027, 1027, 1027, 1000, 8909, 4765, 18095, 1000, 1004, 1004, 2187, 1012, 3200, 1012, 2828, 1027, 1027, 1027, 2157, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
google/material-design-lite
src/layout/layout.js
MaterialLayoutTab
function MaterialLayoutTab(tab, tabs, panels, layout) { /** * Auxiliary method to programmatically select a tab in the UI. */ function selectTab() { var href = tab.href.split('#')[1]; var panel = layout.content_.querySelector('#' + href); layout.resetTabState_(tabs); layout.resetPanelState_(panels); tab.classList.add(layout.CssClasses_.IS_ACTIVE); panel.classList.add(layout.CssClasses_.IS_ACTIVE); } if (layout.tabBar_.classList.contains( layout.CssClasses_.JS_RIPPLE_EFFECT)) { var rippleContainer = document.createElement('span'); rippleContainer.classList.add(layout.CssClasses_.RIPPLE_CONTAINER); rippleContainer.classList.add(layout.CssClasses_.JS_RIPPLE_EFFECT); var ripple = document.createElement('span'); ripple.classList.add(layout.CssClasses_.RIPPLE); rippleContainer.appendChild(ripple); tab.appendChild(rippleContainer); } if (!layout.tabBar_.classList.contains( layout.CssClasses_.TAB_MANUAL_SWITCH)) { tab.addEventListener('click', function(e) { if (tab.getAttribute('href').charAt(0) === '#') { e.preventDefault(); selectTab(); } }); } tab.show = selectTab; }
javascript
function MaterialLayoutTab(tab, tabs, panels, layout) { /** * Auxiliary method to programmatically select a tab in the UI. */ function selectTab() { var href = tab.href.split('#')[1]; var panel = layout.content_.querySelector('#' + href); layout.resetTabState_(tabs); layout.resetPanelState_(panels); tab.classList.add(layout.CssClasses_.IS_ACTIVE); panel.classList.add(layout.CssClasses_.IS_ACTIVE); } if (layout.tabBar_.classList.contains( layout.CssClasses_.JS_RIPPLE_EFFECT)) { var rippleContainer = document.createElement('span'); rippleContainer.classList.add(layout.CssClasses_.RIPPLE_CONTAINER); rippleContainer.classList.add(layout.CssClasses_.JS_RIPPLE_EFFECT); var ripple = document.createElement('span'); ripple.classList.add(layout.CssClasses_.RIPPLE); rippleContainer.appendChild(ripple); tab.appendChild(rippleContainer); } if (!layout.tabBar_.classList.contains( layout.CssClasses_.TAB_MANUAL_SWITCH)) { tab.addEventListener('click', function(e) { if (tab.getAttribute('href').charAt(0) === '#') { e.preventDefault(); selectTab(); } }); } tab.show = selectTab; }
[ "function", "MaterialLayoutTab", "(", "tab", ",", "tabs", ",", "panels", ",", "layout", ")", "{", "/**\n * Auxiliary method to programmatically select a tab in the UI.\n */", "function", "selectTab", "(", ")", "{", "var", "href", "=", "tab", ".", "href", ".", ...
Constructor for an individual tab. @constructor @param {HTMLElement} tab The HTML element for the tab. @param {!Array<HTMLElement>} tabs Array with HTML elements for all tabs. @param {!Array<HTMLElement>} panels Array with HTML elements for all panels. @param {MaterialLayout} layout The MaterialLayout object that owns the tab.
[ "Constructor", "for", "an", "individual", "tab", "." ]
60f441a22ed98ed2c03f6179adf460d888bf459f
https://github.com/google/material-design-lite/blob/60f441a22ed98ed2c03f6179adf460d888bf459f/src/layout/layout.js#L547-L583
train
MaterialLayoutTab is a wrapper around the tab s show method
[ 30522, 3853, 3430, 8485, 5833, 2696, 2497, 1006, 21628, 1010, 21628, 2015, 1010, 9320, 1010, 9621, 1007, 1063, 1013, 1008, 1008, 1008, 9830, 4118, 2000, 2565, 12644, 3973, 7276, 1037, 21628, 1999, 1996, 21318, 1012, 1008, 1013, 3853, 7276, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
mochajs/mocha
lib/errors.js
createNoFilesMatchPatternError
function createNoFilesMatchPatternError(message, pattern) { var err = new Error(message); err.code = 'ERR_MOCHA_NO_FILES_MATCH_PATTERN'; err.pattern = pattern; return err; }
javascript
function createNoFilesMatchPatternError(message, pattern) { var err = new Error(message); err.code = 'ERR_MOCHA_NO_FILES_MATCH_PATTERN'; err.pattern = pattern; return err; }
[ "function", "createNoFilesMatchPatternError", "(", "message", ",", "pattern", ")", "{", "var", "err", "=", "new", "Error", "(", "message", ")", ";", "err", ".", "code", "=", "'ERR_MOCHA_NO_FILES_MATCH_PATTERN'", ";", "err", ".", "pattern", "=", "pattern", ";",...
@module Errors Factory functions to create throwable error objects Creates an error object to be thrown when no files to be tested could be found using specified pattern. @public @param {string} message - Error message to be displayed. @param {string} pattern - User-specified argument value. @returns {Error} instance detailing the error condition
[ "@module", "Errors", "Factory", "functions", "to", "create", "throwable", "error", "objects", "Creates", "an", "error", "object", "to", "be", "thrown", "when", "no", "files", "to", "be", "tested", "could", "be", "found", "using", "specified", "pattern", "." ]
9b00fedb610241e33f7592c40164e42a38a793cf
https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/errors.js#L17-L22
train
Creates an error object that indicates that the specified pattern does not match the specified file pattern.
[ 30522, 3853, 3443, 3630, 8873, 4244, 18900, 2818, 4502, 12079, 3678, 29165, 1006, 4471, 1010, 5418, 1007, 1063, 13075, 9413, 2099, 1027, 2047, 7561, 1006, 4471, 1007, 1025, 9413, 2099, 1012, 3642, 1027, 1005, 9413, 2099, 1035, 9587, 7507, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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
template/web-server/public/js/lib/build/build.js
checkMsg
function checkMsg(msg, protos){ if(!protos){ return false; } for(var name in protos){ var proto = protos[name]; //All required element must exist switch(proto.option){ case 'required' : if(typeof(msg[name]) === 'undefined'){ return false; } case 'optional' : if(typeof(msg[name]) !== 'undefined'){ if(!!protos.__messages[proto.type]){ checkMsg(msg[name], protos.__messages[proto.type]); } } break; case 'repeated' : //Check nest message in repeated elements if(!!msg[name] && !!protos.__messages[proto.type]){ for(var i = 0; i < msg[name].length; i++){ if(!checkMsg(msg[name][i], protos.__messages[proto.type])){ return false; } } } break; } } return true; }
javascript
function checkMsg(msg, protos){ if(!protos){ return false; } for(var name in protos){ var proto = protos[name]; //All required element must exist switch(proto.option){ case 'required' : if(typeof(msg[name]) === 'undefined'){ return false; } case 'optional' : if(typeof(msg[name]) !== 'undefined'){ if(!!protos.__messages[proto.type]){ checkMsg(msg[name], protos.__messages[proto.type]); } } break; case 'repeated' : //Check nest message in repeated elements if(!!msg[name] && !!protos.__messages[proto.type]){ for(var i = 0; i < msg[name].length; i++){ if(!checkMsg(msg[name][i], protos.__messages[proto.type])){ return false; } } } break; } } return true; }
[ "function", "checkMsg", "(", "msg", ",", "protos", ")", "{", "if", "(", "!", "protos", ")", "{", "return", "false", ";", "}", "for", "(", "var", "name", "in", "protos", ")", "{", "var", "proto", "=", "protos", "[", "name", "]", ";", "//All required...
Check if the msg follow the defination in the protos
[ "Check", "if", "the", "msg", "follow", "the", "defination", "in", "the", "protos" ]
defcf019631ed399cc4dad932d3b028a04a039a4
https://github.com/NetEase/pomelo/blob/defcf019631ed399cc4dad932d3b028a04a039a4/template/web-server/public/js/lib/build/build.js#L1041-L1076
train
Check if message is valid
[ 30522, 3853, 4638, 5244, 2290, 1006, 5796, 2290, 1010, 15053, 2015, 1007, 1063, 2065, 1006, 999, 15053, 2015, 1007, 1063, 2709, 6270, 1025, 1065, 2005, 1006, 13075, 2171, 1999, 15053, 2015, 1007, 1063, 13075, 15053, 1027, 15053, 2015, 1031,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/utils/LocalizationUtils.js
getLocalizedLabel
function getLocalizedLabel(locale) { var key = "LOCALE_" + locale.toUpperCase().replace("-", "_"), i18n = Strings[key]; return i18n === undefined ? locale : i18n; }
javascript
function getLocalizedLabel(locale) { var key = "LOCALE_" + locale.toUpperCase().replace("-", "_"), i18n = Strings[key]; return i18n === undefined ? locale : i18n; }
[ "function", "getLocalizedLabel", "(", "locale", ")", "{", "var", "key", "=", "\"LOCALE_\"", "+", "locale", ".", "toUpperCase", "(", ")", ".", "replace", "(", "\"-\"", ",", "\"_\"", ")", ",", "i18n", "=", "Strings", "[", "key", "]", ";", "return", "i18n...
/* Converts a language code to its written name, if possible. If not possible, the language code is simply returned. @param {string} locale The two-char language code @return {string} The language's name or the given language code
[ "/", "*", "Converts", "a", "language", "code", "to", "its", "written", "name", "if", "possible", ".", "If", "not", "possible", "the", "language", "code", "is", "simply", "returned", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/LocalizationUtils.js#L39-L44
train
Get the localized label for a given locale
[ 30522, 3853, 2131, 4135, 9289, 3550, 20470, 2884, 1006, 2334, 2063, 1007, 1063, 13075, 3145, 1027, 1000, 2334, 2063, 1035, 1000, 1009, 2334, 2063, 1012, 2000, 29547, 18992, 3366, 1006, 1007, 1012, 5672, 1006, 1000, 1011, 1000, 1010, 1000, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/preferences/PreferencesBase.js
function (id, value) { if (!_.isEqual(this.data[id], value)) { this._dirty = true; if (value === undefined) { delete this.data[id]; } else { this.data[id] = _.cloneDeep(value); } return true; } return false; }
javascript
function (id, value) { if (!_.isEqual(this.data[id], value)) { this._dirty = true; if (value === undefined) { delete this.data[id]; } else { this.data[id] = _.cloneDeep(value); } return true; } return false; }
[ "function", "(", "id", ",", "value", ")", "{", "if", "(", "!", "_", ".", "isEqual", "(", "this", ".", "data", "[", "id", "]", ",", "value", ")", ")", "{", "this", ".", "_dirty", "=", "true", ";", "if", "(", "value", "===", "undefined", ")", "...
@private Performs the set operation on this Scope's data, deleting the given ID if the new value is undefined. The dirty flag will be set as well. @param {string} id key to set or delete @param {*} value value for this key (undefined to delete) @return {boolean} true if the value was set.
[ "@private" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L393-L404
train
Set a record in the cache
[ 30522, 3853, 1006, 8909, 1010, 3643, 1007, 1063, 2065, 1006, 999, 1035, 1012, 2003, 2063, 26426, 1006, 2023, 1012, 2951, 1031, 8909, 1033, 30524, 1007, 1063, 3972, 12870, 2023, 1012, 2951, 1031, 8909, 1033, 1025, 1065, 2842, 1063, 2023, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/_ODataMetaModelUtils.js
function (oProperty, oEntitySet) { var aFilterRestrictions, sFilterRestrictionValue = mFilterRestrictions[oProperty["sap:filter-restriction"]]; if (!sFilterRestrictionValue) { if (Log.isLoggable(iWARNING, sLoggingModule)) { Log.warning("Unsupported sap:filter-restriction: " + oProperty["sap:filter-restriction"], oEntitySet.entityType + "." + oProperty.name, sLoggingModule); } return; } aFilterRestrictions = oEntitySet["com.sap.vocabularies.Common.v1.FilterExpressionRestrictions"] || []; aFilterRestrictions.push({ "Property" : { "PropertyPath" : oProperty.name}, "AllowedExpressions" : { "EnumMember" : "com.sap.vocabularies.Common.v1.FilterExpressionType/" + sFilterRestrictionValue } }); oEntitySet["com.sap.vocabularies.Common.v1.FilterExpressionRestrictions"] = aFilterRestrictions; }
javascript
function (oProperty, oEntitySet) { var aFilterRestrictions, sFilterRestrictionValue = mFilterRestrictions[oProperty["sap:filter-restriction"]]; if (!sFilterRestrictionValue) { if (Log.isLoggable(iWARNING, sLoggingModule)) { Log.warning("Unsupported sap:filter-restriction: " + oProperty["sap:filter-restriction"], oEntitySet.entityType + "." + oProperty.name, sLoggingModule); } return; } aFilterRestrictions = oEntitySet["com.sap.vocabularies.Common.v1.FilterExpressionRestrictions"] || []; aFilterRestrictions.push({ "Property" : { "PropertyPath" : oProperty.name}, "AllowedExpressions" : { "EnumMember" : "com.sap.vocabularies.Common.v1.FilterExpressionType/" + sFilterRestrictionValue } }); oEntitySet["com.sap.vocabularies.Common.v1.FilterExpressionRestrictions"] = aFilterRestrictions; }
[ "function", "(", "oProperty", ",", "oEntitySet", ")", "{", "var", "aFilterRestrictions", ",", "sFilterRestrictionValue", "=", "mFilterRestrictions", "[", "oProperty", "[", "\"sap:filter-restriction\"", "]", "]", ";", "if", "(", "!", "sFilterRestrictionValue", ")", "...
Adds corresponding V4 annotation for V2 <code>sap:filter-restriction</code> to the given entity set. @param {object} oProperty the property of the entity @param {object} oEntitySet the entity set to which the corresponding V4 annotations need to be added
[ "Adds", "corresponding", "V4", "annotation", "for", "V2", "<code", ">", "sap", ":", "filter", "-", "restriction<", "/", "code", ">", "to", "the", "given", "entity", "set", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_ODataMetaModelUtils.js#L202-L227
train
Adds a filter restriction to the filter restriction list
[ 30522, 3853, 1006, 6728, 18981, 15010, 1010, 1051, 4765, 3012, 13462, 1007, 1063, 13075, 28697, 21928, 28533, 7277, 9285, 1010, 16420, 4014, 3334, 28533, 7277, 3508, 10175, 5657, 1027, 1049, 8873, 21928, 28533, 7277, 9285, 1031, 6728, 18981, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
shipshapecode/shepherd
src/js/utils/general.js
_makeCenteredTippy
function _makeCenteredTippy() { const tippyOptions = { content: this.el, placement: 'top', ...this.options.tippyOptions }; tippyOptions.arrow = false; tippyOptions.popperOptions = tippyOptions.popperOptions || {}; const finalPopperOptions = Object.assign( {}, defaultPopperOptions, tippyOptions.popperOptions, { modifiers: Object.assign( centeredStylePopperModifier, tippyOptions.popperOptions.modifiers ) } ); tippyOptions.popperOptions = finalPopperOptions; return tippy(document.body, tippyOptions); }
javascript
function _makeCenteredTippy() { const tippyOptions = { content: this.el, placement: 'top', ...this.options.tippyOptions }; tippyOptions.arrow = false; tippyOptions.popperOptions = tippyOptions.popperOptions || {}; const finalPopperOptions = Object.assign( {}, defaultPopperOptions, tippyOptions.popperOptions, { modifiers: Object.assign( centeredStylePopperModifier, tippyOptions.popperOptions.modifiers ) } ); tippyOptions.popperOptions = finalPopperOptions; return tippy(document.body, tippyOptions); }
[ "function", "_makeCenteredTippy", "(", ")", "{", "const", "tippyOptions", "=", "{", "content", ":", "this", ".", "el", ",", "placement", ":", "'top'", ",", "...", "this", ".", "options", ".", "tippyOptions", "}", ";", "tippyOptions", ".", "arrow", "=", "...
Generates a `Tippy` instance for a tooltip that doesn't have a target element in the DOM -- and thus is positioned in the center of the view @return {tippy} The final tippy instance @private
[ "Generates", "a", "Tippy", "instance", "for", "a", "tooltip", "that", "doesn", "t", "have", "a", "target", "element", "in", "the", "DOM", "--", "and", "thus", "is", "positioned", "in", "the", "center", "of", "the", "view" ]
0cb1c63fb07b58796358f6d33da5f6405e2b05f4
https://github.com/shipshapecode/shepherd/blob/0cb1c63fb07b58796358f6d33da5f6405e2b05f4/src/js/utils/general.js#L241-L266
train
Make the tippy element centered in the top of the page
[ 30522, 3853, 1035, 2191, 13013, 6850, 25101, 7685, 1006, 1007, 1063, 9530, 3367, 5955, 7685, 7361, 9285, 1027, 1063, 4180, 1024, 2023, 1012, 3449, 1010, 11073, 1024, 1005, 2327, 1005, 1010, 1012, 1012, 1012, 2023, 1012, 7047, 1012, 5955, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
mui-org/material-ui
packages/material-ui-codemod/src/v1.0.0/svg-icon-imports.js
transformSVGIconImports
function transformSVGIconImports(j, root) { const pathMatchRegex = /^material-ui\/svg-icons\/.+\/(.+)$/; root .find(j.Literal) .filter(path => pathMatchRegex.test(path.node.value)) .forEach(path => { const [, iconName] = path.node.value.match(pathMatchRegex); // update to new path path.node.value = `@material-ui/icons/${pascalize(iconName)}`; }); }
javascript
function transformSVGIconImports(j, root) { const pathMatchRegex = /^material-ui\/svg-icons\/.+\/(.+)$/; root .find(j.Literal) .filter(path => pathMatchRegex.test(path.node.value)) .forEach(path => { const [, iconName] = path.node.value.match(pathMatchRegex); // update to new path path.node.value = `@material-ui/icons/${pascalize(iconName)}`; }); }
[ "function", "transformSVGIconImports", "(", "j", ",", "root", ")", "{", "const", "pathMatchRegex", "=", "/", "^material-ui\\/svg-icons\\/.+\\/(.+)$", "/", ";", "root", ".", "find", "(", "j", ".", "Literal", ")", ".", "filter", "(", "path", "=>", "pathMatchRege...
Update all `svg-icons` import references to use `@material-ui/icons` package. Find and replace string literal AST nodes to ensure all svg-icon paths get updated, regardless of being in an import declaration, or a require() call, etc. https://github.com/mui-org/material-ui/tree/master/packages/@material-ui/icons @param {jscodeshift_api_object} j @param {jscodeshift_ast_object} root
[ "Update", "all", "svg", "-", "icons", "import", "references", "to", "use" ]
1555e52367835946382fbf2a8f681de71318915d
https://github.com/mui-org/material-ui/blob/1555e52367835946382fbf2a8f681de71318915d/packages/material-ui-codemod/src/v1.0.0/svg-icon-imports.js#L29-L40
train
Transform SVG icon imports into SVG icon imports
[ 30522, 3853, 21743, 2615, 12863, 10698, 8737, 11589, 2015, 1006, 1046, 1010, 7117, 1007, 1063, 9530, 3367, 4130, 18900, 2818, 2890, 3351, 2595, 1027, 1013, 1034, 3430, 1011, 21318, 1032, 1013, 17917, 2290, 1011, 18407, 1032, 1013, 1012, 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...
goldfire/howler.js
dist/howler.js
function(self) { var url = self._src; // Check if the buffer has already been cached and use it instead. if (cache[url]) { // Set the duration from the cache. self._duration = cache[url].duration; // Load the sound into this Howl. loadSound(self); return; } if (/^data:[^;]+;base64,/.test(url)) { // Decode the base64 data URI without XHR, since some browsers don't support it. var data = atob(url.split(',')[1]); var dataView = new Uint8Array(data.length); for (var i=0; i<data.length; ++i) { dataView[i] = data.charCodeAt(i); } decodeAudioData(dataView.buffer, self); } else { // Load the buffer from the URL. var xhr = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.withCredentials = self._xhrWithCredentials; xhr.responseType = 'arraybuffer'; xhr.onload = function() { // Make sure we get a successful response back. var code = (xhr.status + '')[0]; if (code !== '0' && code !== '2' && code !== '3') { self._emit('loaderror', null, 'Failed loading audio file with status: ' + xhr.status + '.'); return; } decodeAudioData(xhr.response, self); }; xhr.onerror = function() { // If there is an error, switch to HTML5 Audio. if (self._webAudio) { self._html5 = true; self._webAudio = false; self._sounds = []; delete cache[url]; self.load(); } }; safeXhrSend(xhr); } }
javascript
function(self) { var url = self._src; // Check if the buffer has already been cached and use it instead. if (cache[url]) { // Set the duration from the cache. self._duration = cache[url].duration; // Load the sound into this Howl. loadSound(self); return; } if (/^data:[^;]+;base64,/.test(url)) { // Decode the base64 data URI without XHR, since some browsers don't support it. var data = atob(url.split(',')[1]); var dataView = new Uint8Array(data.length); for (var i=0; i<data.length; ++i) { dataView[i] = data.charCodeAt(i); } decodeAudioData(dataView.buffer, self); } else { // Load the buffer from the URL. var xhr = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.withCredentials = self._xhrWithCredentials; xhr.responseType = 'arraybuffer'; xhr.onload = function() { // Make sure we get a successful response back. var code = (xhr.status + '')[0]; if (code !== '0' && code !== '2' && code !== '3') { self._emit('loaderror', null, 'Failed loading audio file with status: ' + xhr.status + '.'); return; } decodeAudioData(xhr.response, self); }; xhr.onerror = function() { // If there is an error, switch to HTML5 Audio. if (self._webAudio) { self._html5 = true; self._webAudio = false; self._sounds = []; delete cache[url]; self.load(); } }; safeXhrSend(xhr); } }
[ "function", "(", "self", ")", "{", "var", "url", "=", "self", ".", "_src", ";", "// Check if the buffer has already been cached and use it instead.", "if", "(", "cache", "[", "url", "]", ")", "{", "// Set the duration from the cache.", "self", ".", "_duration", "=",...
Buffer a sound from URL, Data URI or cache and decode to audio source (Web Audio API). @param {Howl} self
[ "Buffer", "a", "sound", "from", "URL", "Data", "URI", "or", "cache", "and", "decode", "to", "audio", "source", "(", "Web", "Audio", "API", ")", "." ]
030db918dd8ce640afd57e172418472497e8f113
https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L2302-L2353
train
Load the sound from the given URL.
[ 30522, 3853, 1006, 2969, 1007, 1063, 13075, 24471, 2140, 1027, 2969, 1012, 1035, 5034, 2278, 1025, 1013, 1013, 4638, 2065, 1996, 17698, 2038, 2525, 2042, 17053, 2094, 1998, 2224, 2009, 2612, 1012, 2065, 1006, 17053, 1031, 24471, 2140, 1033,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.table/src/sap/ui/table/TableColumnUtils.js
function(oColumn) { var oTable = oColumn.getParent(); if (!oTable || !oTable.getEnableColumnReordering()) { // Column reordering is not active at all return false; } var iCurrentIndex = oTable.indexOfColumn(oColumn); if (iCurrentIndex < oTable.getComputedFixedColumnCount() || iCurrentIndex < oTable._iFirstReorderableIndex) { // No movement of fixed columns or e.g. the first column in the TreeTable return false; } if (TableColumnUtils.hasHeaderSpan(oColumn) || TableColumnUtils.getParentSpannedColumns(oTable, oColumn.getId()).length != 0) { // No movement if the column is spanned by an other column or itself defines a span return false; } return true; }
javascript
function(oColumn) { var oTable = oColumn.getParent(); if (!oTable || !oTable.getEnableColumnReordering()) { // Column reordering is not active at all return false; } var iCurrentIndex = oTable.indexOfColumn(oColumn); if (iCurrentIndex < oTable.getComputedFixedColumnCount() || iCurrentIndex < oTable._iFirstReorderableIndex) { // No movement of fixed columns or e.g. the first column in the TreeTable return false; } if (TableColumnUtils.hasHeaderSpan(oColumn) || TableColumnUtils.getParentSpannedColumns(oTable, oColumn.getId()).length != 0) { // No movement if the column is spanned by an other column or itself defines a span return false; } return true; }
[ "function", "(", "oColumn", ")", "{", "var", "oTable", "=", "oColumn", ".", "getParent", "(", ")", ";", "if", "(", "!", "oTable", "||", "!", "oTable", ".", "getEnableColumnReordering", "(", ")", ")", "{", "// Column reordering is not active at all", "return", ...
Returns true if the column can be moved to another position. @param {sap.ui.table.Column} oColumn Column of the table. @returns {boolean} Whether the column can be moved to another position.
[ "Returns", "true", "if", "the", "column", "can", "be", "moved", "to", "another", "position", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableColumnUtils.js#L386-L406
train
Returns true if the column can be moved to the right position
[ 30522, 3853, 1006, 1051, 25778, 2819, 2078, 1007, 1063, 13075, 27178, 3085, 1027, 1051, 25778, 2819, 2078, 1012, 2131, 19362, 4765, 1006, 1007, 1025, 2065, 1006, 999, 27178, 3085, 1064, 1064, 999, 27178, 3085, 1012, 2131, 8189, 3468, 25778,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/preferences/PreferencesBase.js
function () { if (this._saveInProgress) { if (!this._nextSaveDeferred) { this._nextSaveDeferred = new $.Deferred(); } return this._nextSaveDeferred.promise(); } var deferred = this._nextSaveDeferred || (new $.Deferred()); this._saveInProgress = true; this._nextSaveDeferred = null; Async.doInParallel(_.values(this._scopes), function (scope) { if (scope) { return scope.save(); } else { return (new $.Deferred()).resolve().promise(); } }.bind(this)) .then(function () { this._saveInProgress = false; if (this._nextSaveDeferred) { this.save(); } deferred.resolve(); }.bind(this)) .fail(function (err) { deferred.reject(err); }); return deferred.promise(); }
javascript
function () { if (this._saveInProgress) { if (!this._nextSaveDeferred) { this._nextSaveDeferred = new $.Deferred(); } return this._nextSaveDeferred.promise(); } var deferred = this._nextSaveDeferred || (new $.Deferred()); this._saveInProgress = true; this._nextSaveDeferred = null; Async.doInParallel(_.values(this._scopes), function (scope) { if (scope) { return scope.save(); } else { return (new $.Deferred()).resolve().promise(); } }.bind(this)) .then(function () { this._saveInProgress = false; if (this._nextSaveDeferred) { this.save(); } deferred.resolve(); }.bind(this)) .fail(function (err) { deferred.reject(err); }); return deferred.promise(); }
[ "function", "(", ")", "{", "if", "(", "this", ".", "_saveInProgress", ")", "{", "if", "(", "!", "this", ".", "_nextSaveDeferred", ")", "{", "this", ".", "_nextSaveDeferred", "=", "new", "$", ".", "Deferred", "(", ")", ";", "}", "return", "this", ".",...
Saves the preferences. If a save is already in progress, a Promise is returned for that save operation. @return {Promise} Resolved when the preferences are done saving.
[ "Saves", "the", "preferences", ".", "If", "a", "save", "is", "already", "in", "progress", "a", "Promise", "is", "returned", "for", "that", "save", "operation", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1774-L1805
train
Save all the scopes
[ 30522, 3853, 1006, 1007, 1063, 2065, 1006, 2023, 1012, 1035, 3828, 2378, 21572, 17603, 4757, 1007, 1063, 2065, 1006, 999, 2023, 1012, 1035, 2279, 3736, 7178, 27235, 20529, 1007, 1063, 2023, 1012, 1035, 2279, 3736, 7178, 27235, 20529, 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...
angular/material
gulp/util.js
buildJs
function buildJs() { const jsFiles = config.jsCoreFiles; config.componentPaths.forEach(component => { jsFiles.push(path.join(component, '*.js')); jsFiles.push(path.join(component, '**/*.js')); }); gutil.log("building js files..."); const jsBuildStream = gulp.src(jsFiles) .pipe(filterNonCodeFiles()) .pipe(utils.buildNgMaterialDefinition()) .pipe(plumber()) .pipe(ngAnnotate()) .pipe(utils.addJsWrapper(true)); const jsProcess = series(jsBuildStream, themeBuildStream()) .pipe(concat('angular-material.js')) .pipe(BUILD_MODE.transform()) .pipe(insert.prepend(config.banner)) .pipe(insert.append(';window.ngMaterial={version:{full: "' + VERSION + '"}};')) .pipe(gulp.dest(config.outputDir)) .pipe(gulpif(!IS_DEV, uglify({output: {comments: 'some'}}))) .pipe(rename({extname: '.min.js'})) .pipe(gulp.dest(config.outputDir)); return series(jsProcess, deployMaterialMocks()); // Deploy the `angular-material-mocks.js` file to the `dist` directory function deployMaterialMocks() { return gulp.src(config.mockFiles) .pipe(gulp.dest(config.outputDir)); } }
javascript
function buildJs() { const jsFiles = config.jsCoreFiles; config.componentPaths.forEach(component => { jsFiles.push(path.join(component, '*.js')); jsFiles.push(path.join(component, '**/*.js')); }); gutil.log("building js files..."); const jsBuildStream = gulp.src(jsFiles) .pipe(filterNonCodeFiles()) .pipe(utils.buildNgMaterialDefinition()) .pipe(plumber()) .pipe(ngAnnotate()) .pipe(utils.addJsWrapper(true)); const jsProcess = series(jsBuildStream, themeBuildStream()) .pipe(concat('angular-material.js')) .pipe(BUILD_MODE.transform()) .pipe(insert.prepend(config.banner)) .pipe(insert.append(';window.ngMaterial={version:{full: "' + VERSION + '"}};')) .pipe(gulp.dest(config.outputDir)) .pipe(gulpif(!IS_DEV, uglify({output: {comments: 'some'}}))) .pipe(rename({extname: '.min.js'})) .pipe(gulp.dest(config.outputDir)); return series(jsProcess, deployMaterialMocks()); // Deploy the `angular-material-mocks.js` file to the `dist` directory function deployMaterialMocks() { return gulp.src(config.mockFiles) .pipe(gulp.dest(config.outputDir)); } }
[ "function", "buildJs", "(", ")", "{", "const", "jsFiles", "=", "config", ".", "jsCoreFiles", ";", "config", ".", "componentPaths", ".", "forEach", "(", "component", "=>", "{", "jsFiles", ".", "push", "(", "path", ".", "join", "(", "component", ",", "'*.j...
Builds the entire component library javascript.
[ "Builds", "the", "entire", "component", "library", "javascript", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/gulp/util.js#L43-L76
train
Builds the angular - material. js files
[ 30522, 3853, 3857, 22578, 1006, 1007, 1063, 9530, 3367, 1046, 22747, 9463, 2015, 1027, 9530, 8873, 2290, 1012, 1046, 9363, 2890, 8873, 4244, 1025, 9530, 8873, 2290, 1012, 6922, 15069, 2015, 1012, 18921, 6776, 1006, 6922, 1027, 1028, 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...
eslint/eslint
lib/rules/indent-legacy.js
createErrorMessageData
function createErrorMessageData(expectedAmount, actualSpaces, actualTabs) { const expectedStatement = `${expectedAmount} ${indentType}${expectedAmount === 1 ? "" : "s"}`; // e.g. "2 tabs" const foundSpacesWord = `space${actualSpaces === 1 ? "" : "s"}`; // e.g. "space" const foundTabsWord = `tab${actualTabs === 1 ? "" : "s"}`; // e.g. "tabs" let foundStatement; if (actualSpaces > 0 && actualTabs > 0) { foundStatement = `${actualSpaces} ${foundSpacesWord} and ${actualTabs} ${foundTabsWord}`; // e.g. "1 space and 2 tabs" } else if (actualSpaces > 0) { /* * Abbreviate the message if the expected indentation is also spaces. * e.g. 'Expected 4 spaces but found 2' rather than 'Expected 4 spaces but found 2 spaces' */ foundStatement = indentType === "space" ? actualSpaces : `${actualSpaces} ${foundSpacesWord}`; } else if (actualTabs > 0) { foundStatement = indentType === "tab" ? actualTabs : `${actualTabs} ${foundTabsWord}`; } else { foundStatement = "0"; } return { expected: expectedStatement, actual: foundStatement }; }
javascript
function createErrorMessageData(expectedAmount, actualSpaces, actualTabs) { const expectedStatement = `${expectedAmount} ${indentType}${expectedAmount === 1 ? "" : "s"}`; // e.g. "2 tabs" const foundSpacesWord = `space${actualSpaces === 1 ? "" : "s"}`; // e.g. "space" const foundTabsWord = `tab${actualTabs === 1 ? "" : "s"}`; // e.g. "tabs" let foundStatement; if (actualSpaces > 0 && actualTabs > 0) { foundStatement = `${actualSpaces} ${foundSpacesWord} and ${actualTabs} ${foundTabsWord}`; // e.g. "1 space and 2 tabs" } else if (actualSpaces > 0) { /* * Abbreviate the message if the expected indentation is also spaces. * e.g. 'Expected 4 spaces but found 2' rather than 'Expected 4 spaces but found 2 spaces' */ foundStatement = indentType === "space" ? actualSpaces : `${actualSpaces} ${foundSpacesWord}`; } else if (actualTabs > 0) { foundStatement = indentType === "tab" ? actualTabs : `${actualTabs} ${foundTabsWord}`; } else { foundStatement = "0"; } return { expected: expectedStatement, actual: foundStatement }; }
[ "function", "createErrorMessageData", "(", "expectedAmount", ",", "actualSpaces", ",", "actualTabs", ")", "{", "const", "expectedStatement", "=", "`", "${", "expectedAmount", "}", "${", "indentType", "}", "${", "expectedAmount", "===", "1", "?", "\"\"", ":", "\"...
Creates an error message for a line, given the expected/actual indentation. @param {int} expectedAmount The expected amount of indentation characters for this line @param {int} actualSpaces The actual number of indentation spaces that were found on this line @param {int} actualTabs The actual number of indentation tabs that were found on this line @returns {string} An error message for this line
[ "Creates", "an", "error", "message", "for", "a", "line", "given", "the", "expected", "/", "actual", "indentation", "." ]
bc0819c94aad14f7fad3cbc2338ea15658b0f272
https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/indent-legacy.js#L274-L298
train
Create an error message data object
[ 30522, 3853, 3443, 2121, 29165, 7834, 3736, 5999, 6790, 1006, 3517, 22591, 16671, 1010, 5025, 23058, 2015, 1010, 5025, 2696, 5910, 1007, 1063, 9530, 3367, 3517, 9153, 18532, 4765, 1027, 1036, 1002, 1063, 3517, 22591, 16671, 1065, 1002, 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...
jgraph/mxgraph
javascript/mxClient.js
snapY
function snapY(y, state) { y += this.graph.panDy; var override = false; if (Math.abs(y - middle) < ttY) { dy = y - bounds.getCenterY(); ttY = Math.abs(y - middle); override = true; } else if (Math.abs(y - top) < ttY) { dy = y - bounds.y; ttY = Math.abs(y - top); override = true; } else if (Math.abs(y - bottom) < ttY) { dy = y - bounds.y - bounds.height; ttY = Math.abs(y - bottom); override = true; } if (override) { stateY = state; valueY = Math.round(y - this.graph.panDy); if (this.guideY == null) { this.guideY = this.createGuideShape(false); // Makes sure to use either VML or SVG shapes in order to implement // event-transparency on the background area of the rectangle since // HTML shapes do not let mouseevents through even when transparent this.guideY.dialect = (this.graph.dialect != mxConstants.DIALECT_SVG) ? mxConstants.DIALECT_VML : mxConstants.DIALECT_SVG; this.guideY.pointerEvents = false; this.guideY.init(this.graph.getView().getOverlayPane()); } } overrideY = overrideY || override; }
javascript
function snapY(y, state) { y += this.graph.panDy; var override = false; if (Math.abs(y - middle) < ttY) { dy = y - bounds.getCenterY(); ttY = Math.abs(y - middle); override = true; } else if (Math.abs(y - top) < ttY) { dy = y - bounds.y; ttY = Math.abs(y - top); override = true; } else if (Math.abs(y - bottom) < ttY) { dy = y - bounds.y - bounds.height; ttY = Math.abs(y - bottom); override = true; } if (override) { stateY = state; valueY = Math.round(y - this.graph.panDy); if (this.guideY == null) { this.guideY = this.createGuideShape(false); // Makes sure to use either VML or SVG shapes in order to implement // event-transparency on the background area of the rectangle since // HTML shapes do not let mouseevents through even when transparent this.guideY.dialect = (this.graph.dialect != mxConstants.DIALECT_SVG) ? mxConstants.DIALECT_VML : mxConstants.DIALECT_SVG; this.guideY.pointerEvents = false; this.guideY.init(this.graph.getView().getOverlayPane()); } } overrideY = overrideY || override; }
[ "function", "snapY", "(", "y", ",", "state", ")", "{", "y", "+=", "this", ".", "graph", ".", "panDy", ";", "var", "override", "=", "false", ";", "if", "(", "Math", ".", "abs", "(", "y", "-", "middle", ")", "<", "ttY", ")", "{", "dy", "=", "y"...
Snaps the top, middle or bottom to the given y-coordinate
[ "Snaps", "the", "top", "middle", "or", "bottom", "to", "the", "given", "y", "-", "coordinate" ]
33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44
https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L21901-L21945
train
Snaps the y - coordinate to the top or bottom of the graph
[ 30522, 3853, 10245, 2100, 1006, 1061, 1010, 2110, 1007, 1063, 1061, 1009, 1027, 2023, 1012, 10629, 1012, 6090, 5149, 1025, 13075, 2058, 15637, 1027, 6270, 1025, 2065, 1006, 8785, 1012, 14689, 1006, 1061, 1011, 2690, 1007, 1026, 23746, 2100,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/ToolPopup.js
function (context) { var that = context; assert(!!that, "No ToolPopup instance given for _fnGetInitialFocus"); // if there is an initial focus it was already set to the Popup onBeforeRendering if (!that._bFocusSet) { _fnGetNewFocusElement(that); } else { that._sInitialFocusId = that.oPopup._sInitialFocusId; } return that._sInitialFocusId; }
javascript
function (context) { var that = context; assert(!!that, "No ToolPopup instance given for _fnGetInitialFocus"); // if there is an initial focus it was already set to the Popup onBeforeRendering if (!that._bFocusSet) { _fnGetNewFocusElement(that); } else { that._sInitialFocusId = that.oPopup._sInitialFocusId; } return that._sInitialFocusId; }
[ "function", "(", "context", ")", "{", "var", "that", "=", "context", ";", "assert", "(", "!", "!", "that", ",", "\"No ToolPopup instance given for _fnGetInitialFocus\"", ")", ";", "// if there is an initial focus it was already set to the Popup onBeforeRendering", "if", "("...
Checks if the ToolPopup already has a tabbable element. If not, it's checked whether the fake-element should be used or if there is an element that could be focused instead. @param {sap.ui.ux3.ToolPopup} context to get/set instance values @returns {string} _sInitialFocusId that has been determined here @private
[ "Checks", "if", "the", "ToolPopup", "already", "has", "a", "tabbable", "element", ".", "If", "not", "it", "s", "checked", "whether", "the", "fake", "-", "element", "should", "be", "used", "or", "if", "there", "is", "an", "element", "that", "could", "be",...
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ToolPopup.js#L307-L319
train
Get the initial focus element
[ 30522, 3853, 1006, 6123, 1007, 1063, 13075, 2008, 1027, 6123, 1025, 20865, 1006, 999, 999, 2008, 1010, 1000, 2053, 6994, 16340, 6279, 6013, 2445, 2005, 1035, 1042, 15465, 7629, 29050, 10270, 10085, 2271, 1000, 1007, 1025, 1013, 1013, 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...
openlayers/openlayers
examples/wms-custom-proj.js
DEGtoSEC
function DEGtoSEC(angle) { // Extract DMS const deg = parseInt(angle, 10); let min = parseInt((angle - deg) * 100, 10); let sec = (((angle - deg) * 100) - min) * 100; // Avoid rounding problems with seconds=0 const parts = String(angle).split('.'); if (parts.length == 2 && parts[1].length == 2) { min = Number(parts[1]); sec = 0; } // Result in degrees sex (dd.mmss) return sec + min * 60 + deg * 3600; }
javascript
function DEGtoSEC(angle) { // Extract DMS const deg = parseInt(angle, 10); let min = parseInt((angle - deg) * 100, 10); let sec = (((angle - deg) * 100) - min) * 100; // Avoid rounding problems with seconds=0 const parts = String(angle).split('.'); if (parts.length == 2 && parts[1].length == 2) { min = Number(parts[1]); sec = 0; } // Result in degrees sex (dd.mmss) return sec + min * 60 + deg * 3600; }
[ "function", "DEGtoSEC", "(", "angle", ")", "{", "// Extract DMS", "const", "deg", "=", "parseInt", "(", "angle", ",", "10", ")", ";", "let", "min", "=", "parseInt", "(", "(", "angle", "-", "deg", ")", "*", "100", ",", "10", ")", ";", "let", "sec", ...
Convert Degrees angle to seconds
[ "Convert", "Degrees", "angle", "to", "seconds" ]
f366eaea522388fb575b11010e69d309164baca7
https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/examples/wms-custom-proj.js#L206-L223
train
Convert DMS angle to seconds
[ 30522, 3853, 2139, 13512, 9232, 2278, 1006, 6466, 1007, 1063, 1013, 1013, 14817, 1040, 5244, 9530, 3367, 2139, 2290, 1027, 11968, 20240, 3372, 1006, 6466, 1010, 2184, 1007, 1025, 2292, 8117, 1027, 11968, 20240, 3372, 1006, 1006, 6466, 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...
wangfupeng1988/wangEditor
example/server/util.js
function (obj, fn) { let key, result for (key in obj) { if (obj.hasOwnProperty(key)) { result = fn.call(obj, key, obj[key]) if (result === false) { break } } } }
javascript
function (obj, fn) { let key, result for (key in obj) { if (obj.hasOwnProperty(key)) { result = fn.call(obj, key, obj[key]) if (result === false) { break } } } }
[ "function", "(", "obj", ",", "fn", ")", "{", "let", "key", ",", "result", "for", "(", "key", "in", "obj", ")", "{", "if", "(", "obj", ".", "hasOwnProperty", "(", "key", ")", ")", "{", "result", "=", "fn", ".", "call", "(", "obj", ",", "key", ...
遍历对象
[ "遍历对象" ]
b77696f5e81c8ec13d9d341252d6b9fa8a22db18
https://github.com/wangfupeng1988/wangEditor/blob/b77696f5e81c8ec13d9d341252d6b9fa8a22db18/example/server/util.js#L3-L13
train
call a function for each key in obj
[ 30522, 3853, 1006, 27885, 3501, 1010, 1042, 2078, 1007, 1063, 2292, 3145, 1010, 2765, 2005, 1006, 3145, 1999, 27885, 3501, 1007, 1063, 2065, 1006, 27885, 3501, 1012, 2038, 12384, 21572, 4842, 3723, 1006, 3145, 1007, 1007, 1063, 2765, 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...
30-seconds/30-seconds-of-code
scripts/module.js
build
async function build() { console.time('Packager'); let requires = []; let esmExportString = ''; let cjsExportString = ''; try { if (!fs.existsSync(DIST_PATH)) fs.mkdirSync(DIST_PATH); fs.writeFileSync(ROLLUP_INPUT_FILE, ''); fs.writeFileSync(TEST_MODULE_FILE, ''); // All the snippets that are Node.js-based and will break in a browser // environment const nodeSnippets = fs .readFileSync('tag_database', 'utf8') .split('\n') .filter(v => v.search(/:.*node/g) !== -1) .map(v => v.slice(0, v.indexOf(':'))); const snippets = fs.readdirSync(SNIPPETS_PATH); const archivedSnippets = fs .readdirSync(SNIPPETS_ARCHIVE_PATH) .filter(v => v !== 'README.md'); snippets.forEach(snippet => { const rawSnippetString = getRawSnippetString(SNIPPETS_PATH, snippet); const snippetName = snippet.replace('.md', ''); let code = getCode(rawSnippetString); if (nodeSnippets.includes(snippetName)) { requires.push(code.match(/const.*=.*require\(([^\)]*)\);/g)); code = code.replace(/const.*=.*require\(([^\)]*)\);/g, ''); } esmExportString += `export ${code}`; cjsExportString += code; }); archivedSnippets.forEach(snippet => { const rawSnippetString = getRawSnippetString( SNIPPETS_ARCHIVE_PATH, snippet ); cjsExportString += getCode(rawSnippetString); }); requires = [ ...new Set( requires .filter(Boolean) .map(v => v[0].replace( 'require(', 'typeof require !== "undefined" && require(' ) ) ) ].join('\n'); fs.writeFileSync(ROLLUP_INPUT_FILE, `${requires}\n\n${esmExportString}`); const testExports = `module.exports = {${[...snippets, ...archivedSnippets] .map(v => v.replace('.md', '')) .join(',')}}`; fs.writeFileSync( TEST_MODULE_FILE, `${requires}\n\n${cjsExportString}\n\n${testExports}` ); // Check Travis builds - Will skip builds on Travis if not CRON/API if (util.isTravisCI() && util.isNotTravisCronOrAPI()) { fs.unlink(ROLLUP_INPUT_FILE); console.log( `${chalk.green( 'NOBUILD' )} Module build terminated, not a cron job or a custom build!` ); console.timeEnd('Packager'); process.exit(0); } await doRollup(); // Clean up the temporary input file Rollup used for building the module fs.unlink(ROLLUP_INPUT_FILE); console.log(`${chalk.green('SUCCESS!')} Snippet module built!`); console.timeEnd('Packager'); } catch (err) { console.log(`${chalk.red('ERROR!')} During module creation: ${err}`); process.exit(1); } }
javascript
async function build() { console.time('Packager'); let requires = []; let esmExportString = ''; let cjsExportString = ''; try { if (!fs.existsSync(DIST_PATH)) fs.mkdirSync(DIST_PATH); fs.writeFileSync(ROLLUP_INPUT_FILE, ''); fs.writeFileSync(TEST_MODULE_FILE, ''); // All the snippets that are Node.js-based and will break in a browser // environment const nodeSnippets = fs .readFileSync('tag_database', 'utf8') .split('\n') .filter(v => v.search(/:.*node/g) !== -1) .map(v => v.slice(0, v.indexOf(':'))); const snippets = fs.readdirSync(SNIPPETS_PATH); const archivedSnippets = fs .readdirSync(SNIPPETS_ARCHIVE_PATH) .filter(v => v !== 'README.md'); snippets.forEach(snippet => { const rawSnippetString = getRawSnippetString(SNIPPETS_PATH, snippet); const snippetName = snippet.replace('.md', ''); let code = getCode(rawSnippetString); if (nodeSnippets.includes(snippetName)) { requires.push(code.match(/const.*=.*require\(([^\)]*)\);/g)); code = code.replace(/const.*=.*require\(([^\)]*)\);/g, ''); } esmExportString += `export ${code}`; cjsExportString += code; }); archivedSnippets.forEach(snippet => { const rawSnippetString = getRawSnippetString( SNIPPETS_ARCHIVE_PATH, snippet ); cjsExportString += getCode(rawSnippetString); }); requires = [ ...new Set( requires .filter(Boolean) .map(v => v[0].replace( 'require(', 'typeof require !== "undefined" && require(' ) ) ) ].join('\n'); fs.writeFileSync(ROLLUP_INPUT_FILE, `${requires}\n\n${esmExportString}`); const testExports = `module.exports = {${[...snippets, ...archivedSnippets] .map(v => v.replace('.md', '')) .join(',')}}`; fs.writeFileSync( TEST_MODULE_FILE, `${requires}\n\n${cjsExportString}\n\n${testExports}` ); // Check Travis builds - Will skip builds on Travis if not CRON/API if (util.isTravisCI() && util.isNotTravisCronOrAPI()) { fs.unlink(ROLLUP_INPUT_FILE); console.log( `${chalk.green( 'NOBUILD' )} Module build terminated, not a cron job or a custom build!` ); console.timeEnd('Packager'); process.exit(0); } await doRollup(); // Clean up the temporary input file Rollup used for building the module fs.unlink(ROLLUP_INPUT_FILE); console.log(`${chalk.green('SUCCESS!')} Snippet module built!`); console.timeEnd('Packager'); } catch (err) { console.log(`${chalk.red('ERROR!')} During module creation: ${err}`); process.exit(1); } }
[ "async", "function", "build", "(", ")", "{", "console", ".", "time", "(", "'Packager'", ")", ";", "let", "requires", "=", "[", "]", ";", "let", "esmExportString", "=", "''", ";", "let", "cjsExportString", "=", "''", ";", "try", "{", "if", "(", "!", ...
Starts the build process.
[ "Starts", "the", "build", "process", "." ]
5ef18713903aaaa5ff5409ef3a6de31dbd878d0c
https://github.com/30-seconds/30-seconds-of-code/blob/5ef18713903aaaa5ff5409ef3a6de31dbd878d0c/scripts/module.js#L74-L165
train
Build the project
[ 30522, 2004, 6038, 2278, 3853, 3857, 1006, 1007, 1063, 10122, 1012, 2051, 1006, 1005, 7427, 2099, 1005, 1007, 1025, 2292, 5942, 1027, 1031, 1033, 1025, 2292, 9686, 4168, 2595, 25378, 18886, 3070, 1027, 1005, 1005, 1025, 2292, 1039, 22578, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.m/src/sap/m/Support.js
onTouchStart
function onTouchStart(oEvent) { if (oEvent.touches) { var currentTouches = oEvent.touches.length; if (Device.browser.mobile && (Device.browser.name === Device.browser.BROWSER.INTERNET_EXPLORER ||// TODO remove after 1.62 version Device.browser.name === Device.browser.BROWSER.EDGE)) { windowsPhoneTouches = currentTouches; } if (currentTouches > maxFingersAllowed) { document.removeEventListener('touchend', onTouchEnd); return; } switch (currentTouches) { case holdFingersNumber: startTime = Date.now(); document.addEventListener('touchend', onTouchEnd); break; case maxFingersAllowed: if (startTime) { timeDiff = Date.now() - startTime; lastTouchUID = oEvent.touches[currentTouches - 1].identifier; } break; } } }
javascript
function onTouchStart(oEvent) { if (oEvent.touches) { var currentTouches = oEvent.touches.length; if (Device.browser.mobile && (Device.browser.name === Device.browser.BROWSER.INTERNET_EXPLORER ||// TODO remove after 1.62 version Device.browser.name === Device.browser.BROWSER.EDGE)) { windowsPhoneTouches = currentTouches; } if (currentTouches > maxFingersAllowed) { document.removeEventListener('touchend', onTouchEnd); return; } switch (currentTouches) { case holdFingersNumber: startTime = Date.now(); document.addEventListener('touchend', onTouchEnd); break; case maxFingersAllowed: if (startTime) { timeDiff = Date.now() - startTime; lastTouchUID = oEvent.touches[currentTouches - 1].identifier; } break; } } }
[ "function", "onTouchStart", "(", "oEvent", ")", "{", "if", "(", "oEvent", ".", "touches", ")", "{", "var", "currentTouches", "=", "oEvent", ".", "touches", ".", "length", ";", "if", "(", "Device", ".", "browser", ".", "mobile", "&&", "(", "Device", "."...
function is triggered when a touch is detected
[ "function", "is", "triggered", "when", "a", "touch", "is", "detected" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/Support.js#L277-L308
train
touchstart event handler
[ 30522, 3853, 3031, 10875, 14117, 2102, 1006, 1051, 18697, 3372, 1007, 1063, 2065, 1006, 1051, 18697, 3372, 1012, 12817, 1007, 1063, 13075, 2783, 24826, 8376, 1027, 1051, 18697, 3372, 1012, 12817, 1012, 3091, 1025, 2065, 1006, 5080, 1012, 16...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
ccxt/ccxt
build/transpile.js
createPythonClass
function createPythonClass (className, baseClass, body, methods, async = false) { const pythonStandardLibraries = { 'base64': 'base64', 'hashlib': 'hashlib', 'math': 'math', 'json.loads': 'json', } async = async ? 'async_support.' : '' const importFrom = (baseClass == 'Exchange') ? ('ccxt.' + async + 'base.exchange') : ('ccxt.' + async + baseClass) let bodyAsString = body.join ("\n") let header = [ "# -*- coding: utf-8 -*-\n", "# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:", "# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code\n", 'from ' + importFrom + ' import ' + baseClass, ... (bodyAsString.match (/basestring/) ? [ "\n# -----------------------------------------------------------------------------\n", "try:", " basestring # Python 3", "except NameError:", " basestring = str # Python 2", ] : []) ] const libraries = [] for (let library in pythonStandardLibraries) { const regex = new RegExp ("[^\\']" + library + "[^\\'a-zA-Z]") if (bodyAsString.match (regex)) libraries.push ('import ' + pythonStandardLibraries[library]) } const errorImports = [] for (let error in errors) { const regex = new RegExp ("[^\\'\"]" + error + "[^\\'\"]") if (bodyAsString.match (regex)) errorImports.push ('from ccxt.base.errors import ' + error) } const precisionImports = [] for (let constant in precisionConstants) { if (bodyAsString.indexOf (constant) >= 0) { precisionImports.push ('from ccxt.base.decimal_to_precision import ' + constant) } } header = header.concat (libraries, errorImports, precisionImports) for (let method of methods) { const regex = new RegExp ('self\\.(' + method + ')\\s*\\(', 'g') bodyAsString = bodyAsString.replace (regex, (match, p1) => ('self.' + unCamelCase (p1) + '(')) } header.push ("\n\nclass " + className + ' (' + baseClass + '):') const footer = [ '', // footer (last empty line) ] const result = header.join ("\n") + "\n" + bodyAsString + "\n" + footer.join ('\n') return result }
javascript
function createPythonClass (className, baseClass, body, methods, async = false) { const pythonStandardLibraries = { 'base64': 'base64', 'hashlib': 'hashlib', 'math': 'math', 'json.loads': 'json', } async = async ? 'async_support.' : '' const importFrom = (baseClass == 'Exchange') ? ('ccxt.' + async + 'base.exchange') : ('ccxt.' + async + baseClass) let bodyAsString = body.join ("\n") let header = [ "# -*- coding: utf-8 -*-\n", "# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:", "# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code\n", 'from ' + importFrom + ' import ' + baseClass, ... (bodyAsString.match (/basestring/) ? [ "\n# -----------------------------------------------------------------------------\n", "try:", " basestring # Python 3", "except NameError:", " basestring = str # Python 2", ] : []) ] const libraries = [] for (let library in pythonStandardLibraries) { const regex = new RegExp ("[^\\']" + library + "[^\\'a-zA-Z]") if (bodyAsString.match (regex)) libraries.push ('import ' + pythonStandardLibraries[library]) } const errorImports = [] for (let error in errors) { const regex = new RegExp ("[^\\'\"]" + error + "[^\\'\"]") if (bodyAsString.match (regex)) errorImports.push ('from ccxt.base.errors import ' + error) } const precisionImports = [] for (let constant in precisionConstants) { if (bodyAsString.indexOf (constant) >= 0) { precisionImports.push ('from ccxt.base.decimal_to_precision import ' + constant) } } header = header.concat (libraries, errorImports, precisionImports) for (let method of methods) { const regex = new RegExp ('self\\.(' + method + ')\\s*\\(', 'g') bodyAsString = bodyAsString.replace (regex, (match, p1) => ('self.' + unCamelCase (p1) + '(')) } header.push ("\n\nclass " + className + ' (' + baseClass + '):') const footer = [ '', // footer (last empty line) ] const result = header.join ("\n") + "\n" + bodyAsString + "\n" + footer.join ('\n') return result }
[ "function", "createPythonClass", "(", "className", ",", "baseClass", ",", "body", ",", "methods", ",", "async", "=", "false", ")", "{", "const", "pythonStandardLibraries", "=", "{", "'base64'", ":", "'base64'", ",", "'hashlib'", ":", "'hashlib'", ",", "'math'"...
---------------------------------------------------------------------------- one-time helpers
[ "----------------------------------------------------------------------------", "one", "-", "time", "helpers" ]
8168069b9180a465532905e225586215e115a565
https://github.com/ccxt/ccxt/blob/8168069b9180a465532905e225586215e115a565/build/transpile.js#L374-L445
train
Creates a Python class
[ 30522, 3853, 3443, 7685, 2705, 2239, 26266, 1006, 2465, 18442, 1010, 2918, 26266, 1010, 2303, 1010, 4725, 1010, 2004, 6038, 2278, 1027, 6270, 1007, 1063, 9530, 3367, 18750, 21515, 4232, 29521, 19848, 3111, 1027, 1063, 1005, 2918, 21084, 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/LiveDevelopment/Agents/RemoteFunctions.js
_screenOffset
function _screenOffset(element) { var elemBounds = element.getBoundingClientRect(), body = window.document.body, offsetTop, offsetLeft; if (window.getComputedStyle(body).position === "static") { offsetLeft = elemBounds.left + window.pageXOffset; offsetTop = elemBounds.top + window.pageYOffset; } else { var bodyBounds = body.getBoundingClientRect(); offsetLeft = elemBounds.left - bodyBounds.left; offsetTop = elemBounds.top - bodyBounds.top; } return { left: offsetLeft, top: offsetTop }; }
javascript
function _screenOffset(element) { var elemBounds = element.getBoundingClientRect(), body = window.document.body, offsetTop, offsetLeft; if (window.getComputedStyle(body).position === "static") { offsetLeft = elemBounds.left + window.pageXOffset; offsetTop = elemBounds.top + window.pageYOffset; } else { var bodyBounds = body.getBoundingClientRect(); offsetLeft = elemBounds.left - bodyBounds.left; offsetTop = elemBounds.top - bodyBounds.top; } return { left: offsetLeft, top: offsetTop }; }
[ "function", "_screenOffset", "(", "element", ")", "{", "var", "elemBounds", "=", "element", ".", "getBoundingClientRect", "(", ")", ",", "body", "=", "window", ".", "document", ".", "body", ",", "offsetTop", ",", "offsetLeft", ";", "if", "(", "window", "."...
compute the screen offset of an element
[ "compute", "the", "screen", "offset", "of", "an", "element" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/RemoteFunctions.js#L91-L106
train
Get screen offset
[ 30522, 3853, 1035, 3898, 27475, 3388, 1006, 5783, 1007, 1063, 13075, 3449, 6633, 15494, 2015, 1027, 5783, 1012, 2131, 15494, 2075, 20464, 11638, 2890, 6593, 1006, 1007, 1010, 2303, 1027, 3332, 1012, 6254, 1012, 2303, 1010, 16396, 14399, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/view/WorkspaceManager.js
handleWindowResize
function handleWindowResize() { // These are not initialized in Jasmine Spec Runner window until a test // is run that creates a mock document. if (!$windowContent || !$editorHolder) { return; } // FIXME (issue #4564) Workaround https://github.com/codemirror/CodeMirror/issues/1787 triggerUpdateLayout(); if (!windowResizing) { windowResizing = true; // We don't need any fancy debouncing here - we just need to react before the user can start // resizing any panels at the new window size. So just listen for first mousemove once the // window resize releases mouse capture. $(window.document).one("mousemove", function () { windowResizing = false; updateResizeLimits(); }); } }
javascript
function handleWindowResize() { // These are not initialized in Jasmine Spec Runner window until a test // is run that creates a mock document. if (!$windowContent || !$editorHolder) { return; } // FIXME (issue #4564) Workaround https://github.com/codemirror/CodeMirror/issues/1787 triggerUpdateLayout(); if (!windowResizing) { windowResizing = true; // We don't need any fancy debouncing here - we just need to react before the user can start // resizing any panels at the new window size. So just listen for first mousemove once the // window resize releases mouse capture. $(window.document).one("mousemove", function () { windowResizing = false; updateResizeLimits(); }); } }
[ "function", "handleWindowResize", "(", ")", "{", "// These are not initialized in Jasmine Spec Runner window until a test", "// is run that creates a mock document.", "if", "(", "!", "$windowContent", "||", "!", "$editorHolder", ")", "{", "return", ";", "}", "// FIXME (issue #4...
Trigger editor area resize whenever the window is resized
[ "Trigger", "editor", "area", "resize", "whenever", "the", "window", "is", "resized" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/WorkspaceManager.js#L123-L144
train
Handle window resize
[ 30522, 3853, 5047, 11101, 5004, 6072, 4697, 1006, 1007, 1063, 1013, 1013, 2122, 2024, 2025, 3988, 3550, 1999, 14032, 28699, 5479, 3332, 2127, 1037, 3231, 1013, 1013, 30524, 2147, 24490, 16770, 1024, 1013, 1013, 21025, 2705, 12083, 1012, 401...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
feross/simple-peer
index.js
flattenValues
function flattenValues (report) { if (Object.prototype.toString.call(report.values) === '[object Array]') { report.values.forEach(function (value) { Object.assign(report, value) }) } return report }
javascript
function flattenValues (report) { if (Object.prototype.toString.call(report.values) === '[object Array]') { report.values.forEach(function (value) { Object.assign(report, value) }) } return report }
[ "function", "flattenValues", "(", "report", ")", "{", "if", "(", "Object", ".", "prototype", ".", "toString", ".", "call", "(", "report", ".", "values", ")", "===", "'[object Array]'", ")", "{", "report", ".", "values", ".", "forEach", "(", "function", "...
statreports can come with a value array instead of properties
[ "statreports", "can", "come", "with", "a", "value", "array", "instead", "of", "properties" ]
3ed91bf631c4bf9c3b4bf5a85d004bb70d621707
https://github.com/feross/simple-peer/blob/3ed91bf631c4bf9c3b4bf5a85d004bb70d621707/index.js#L742-L749
train
flatten values
[ 30522, 3853, 4257, 6528, 10175, 15808, 1006, 3189, 1007, 1063, 2065, 1006, 4874, 1012, 8773, 1012, 2000, 3367, 4892, 1012, 2655, 1006, 3189, 1012, 5300, 1007, 1027, 1027, 1027, 1005, 1031, 4874, 9140, 1033, 1005, 1007, 1063, 3189, 1012, 5...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jgraph/mxgraph
javascript/mxClient.js
function(evt) { return (evt.type != null && evt.type.indexOf('touch') == 0 && evt.touches != null && evt.touches.length > 1); }
javascript
function(evt) { return (evt.type != null && evt.type.indexOf('touch') == 0 && evt.touches != null && evt.touches.length > 1); }
[ "function", "(", "evt", ")", "{", "return", "(", "evt", ".", "type", "!=", "null", "&&", "evt", ".", "type", ".", "indexOf", "(", "'touch'", ")", "==", "0", "&&", "evt", ".", "touches", "!=", "null", "&&", "evt", ".", "touches", ".", "length", ">...
Function: isMultiTouchEvent Returns true if the event was generated using a touch device (not a pen or mouse).
[ "Function", ":", "isMultiTouchEvent" ]
33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44
https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L9847-L9850
train
Returns true if the event is a touch event
[ 30522, 3853, 1006, 23408, 2102, 1007, 1063, 2709, 1006, 23408, 2102, 1012, 2828, 999, 1027, 19701, 1004, 1004, 23408, 2102, 1012, 2828, 1012, 5950, 11253, 1006, 1005, 3543, 1005, 1007, 1027, 1027, 1014, 1004, 1004, 23408, 2102, 1012, 12817,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/modifiers/modifyHTML.js
modifyHTML
function modifyHTML(page, operations) { var html = page.getContent(); var $ = cheerio.load(html); return Promise.forEach(operations, function(op) { return op($); }) .then(function() { var resultHTML = $.html(); return page.set('content', resultHTML); }); }
javascript
function modifyHTML(page, operations) { var html = page.getContent(); var $ = cheerio.load(html); return Promise.forEach(operations, function(op) { return op($); }) .then(function() { var resultHTML = $.html(); return page.set('content', resultHTML); }); }
[ "function", "modifyHTML", "(", "page", ",", "operations", ")", "{", "var", "html", "=", "page", ".", "getContent", "(", ")", ";", "var", "$", "=", "cheerio", ".", "load", "(", "html", ")", ";", "return", "Promise", ".", "forEach", "(", "operations", ...
Apply a list of operations to a page and output the new page. @param {Page} @param {List|Array<Transformation>} @return {Promise<Page>}
[ "Apply", "a", "list", "of", "operations", "to", "a", "page", "and", "output", "the", "new", "page", "." ]
6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4
https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/output/modifiers/modifyHTML.js#L12-L23
train
Modify the HTML of a page
[ 30522, 3853, 19933, 11039, 19968, 1006, 3931, 1010, 3136, 1007, 1063, 13075, 16129, 1027, 3931, 1012, 2131, 8663, 6528, 2102, 1006, 1007, 1025, 13075, 1002, 1027, 15138, 3695, 1012, 7170, 1006, 16129, 1007, 1025, 2709, 4872, 1012, 18921, 67...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/layout/PositionContainer.js
function(oPositionContainer, oControl, sProp, sPos1, sVal1, sPos2, sVal2) { if (sVal1 && sVal2) { var oLayout = oPositionContainer.getParent(); var oProp = getPropertyInfo(oControl, sProp); if (oProp) { var val = oControl[oProp._sGetter](); if (!(!val || val == "" || val == "auto" || val == "inherit")) { Log.warning("Position " + sPos2 + "=" + sVal2 + " ignored, because child control " + oControl.getId() + " has fixed " + sProp + " (" + val + ").", "", "AbsoluteLayout '" + (oLayout ? oLayout.getId() : "_undefined") + "'"); return false; } } else { if ((sProp === "width" && !oPositionContainer._disableWidthCheck) || (sProp === "height" && !oPositionContainer._disableHeightCheck)) { Log.warning("Position " + sPos2 + "=" + sVal2 + " ignored, because child control " + oControl.getId() + " not resizable.", "", "AbsoluteLayout '" + (oLayout ? oLayout.getId() : "_undefined") + "'"); return false; } } } return true; }
javascript
function(oPositionContainer, oControl, sProp, sPos1, sVal1, sPos2, sVal2) { if (sVal1 && sVal2) { var oLayout = oPositionContainer.getParent(); var oProp = getPropertyInfo(oControl, sProp); if (oProp) { var val = oControl[oProp._sGetter](); if (!(!val || val == "" || val == "auto" || val == "inherit")) { Log.warning("Position " + sPos2 + "=" + sVal2 + " ignored, because child control " + oControl.getId() + " has fixed " + sProp + " (" + val + ").", "", "AbsoluteLayout '" + (oLayout ? oLayout.getId() : "_undefined") + "'"); return false; } } else { if ((sProp === "width" && !oPositionContainer._disableWidthCheck) || (sProp === "height" && !oPositionContainer._disableHeightCheck)) { Log.warning("Position " + sPos2 + "=" + sVal2 + " ignored, because child control " + oControl.getId() + " not resizable.", "", "AbsoluteLayout '" + (oLayout ? oLayout.getId() : "_undefined") + "'"); return false; } } } return true; }
[ "function", "(", "oPositionContainer", ",", "oControl", ",", "sProp", ",", "sPos1", ",", "sVal1", ",", "sPos2", ",", "sVal2", ")", "{", "if", "(", "sVal1", "&&", "sVal2", ")", "{", "var", "oLayout", "=", "oPositionContainer", ".", "getParent", "(", ")", ...
Checks whether the position settings fits to the set height/width attribute of a control. @private
[ "Checks", "whether", "the", "position", "settings", "fits", "to", "the", "set", "height", "/", "width", "attribute", "of", "a", "control", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/layout/PositionContainer.js#L376-L396
train
Checks if the control has fixed property
[ 30522, 3853, 1006, 6728, 19234, 8663, 18249, 2121, 1010, 1051, 8663, 13181, 2140, 1010, 11867, 18981, 1010, 11867, 2891, 2487, 1010, 17917, 2389, 2487, 1010, 11867, 2891, 2475, 1010, 17917, 2389, 2475, 1007, 1063, 2065, 1006, 17917, 2389, 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...
ColorlibHQ/AdminLTE
plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js
splitDataNode
function splitDataNode(node, index, positionsToPreserve) { var newNode = node.cloneNode(false); newNode.deleteData(0, index); node.deleteData(index, node.length - index); insertAfter(newNode, node); // Preserve positions if (positionsToPreserve) { for (var i = 0, position; position = positionsToPreserve[i++]; ) { // Handle case where position was inside the portion of node after the split point if (position.node == node && position.offset > index) { position.node = newNode; position.offset -= index; } // Handle the case where the position is a node offset within node's parent else if (position.node == node.parentNode && position.offset > getNodeIndex(node)) { ++position.offset; } } } return newNode; }
javascript
function splitDataNode(node, index, positionsToPreserve) { var newNode = node.cloneNode(false); newNode.deleteData(0, index); node.deleteData(index, node.length - index); insertAfter(newNode, node); // Preserve positions if (positionsToPreserve) { for (var i = 0, position; position = positionsToPreserve[i++]; ) { // Handle case where position was inside the portion of node after the split point if (position.node == node && position.offset > index) { position.node = newNode; position.offset -= index; } // Handle the case where the position is a node offset within node's parent else if (position.node == node.parentNode && position.offset > getNodeIndex(node)) { ++position.offset; } } } return newNode; }
[ "function", "splitDataNode", "(", "node", ",", "index", ",", "positionsToPreserve", ")", "{", "var", "newNode", "=", "node", ".", "cloneNode", "(", "false", ")", ";", "newNode", ".", "deleteData", "(", "0", ",", "index", ")", ";", "node", ".", "deleteDat...
Note that we cannot use splitText() because it is bugridden in IE 9.
[ "Note", "that", "we", "cannot", "use", "splitText", "()", "because", "it", "is", "bugridden", "in", "IE", "9", "." ]
19113c3cbc19a7afe0cfd3158d647064d2d30661
https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L658-L679
train
Split data node at the given index.
[ 30522, 3853, 3975, 2850, 5794, 10244, 1006, 13045, 1010, 5950, 1010, 4460, 14399, 6072, 2121, 3726, 1007, 1063, 13075, 2047, 3630, 3207, 1027, 13045, 1012, 17598, 3630, 3207, 1006, 6270, 1007, 1025, 2047, 3630, 3207, 1012, 17159, 6790, 1006...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/language/JSONUtils.js
stripQuotes
function stripQuotes(string) { if (string) { if (/^['"]$/.test(string.charAt(0))) { string = string.substr(1); } if (/^['"]$/.test(string.substr(-1, 1))) { string = string.substr(0, string.length - 1); } } return string; }
javascript
function stripQuotes(string) { if (string) { if (/^['"]$/.test(string.charAt(0))) { string = string.substr(1); } if (/^['"]$/.test(string.substr(-1, 1))) { string = string.substr(0, string.length - 1); } } return string; }
[ "function", "stripQuotes", "(", "string", ")", "{", "if", "(", "string", ")", "{", "if", "(", "/", "^['\"]$", "/", ".", "test", "(", "string", ".", "charAt", "(", "0", ")", ")", ")", "{", "string", "=", "string", ".", "substr", "(", "1", ")", "...
Removes the quotes around a string @param {!String} string @return {String}
[ "Removes", "the", "quotes", "around", "a", "string" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/JSONUtils.js#L75-L85
train
strip quotes from string
[ 30522, 3853, 6167, 28940, 12184, 2015, 1006, 5164, 1007, 1063, 2065, 1006, 5164, 1007, 1063, 2065, 1006, 1013, 1034, 1031, 1005, 1000, 1033, 1002, 1013, 1012, 3231, 1006, 5164, 1012, 25869, 30524, 1010, 1015, 1007, 1007, 1007, 1063, 5164, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/incubator-echarts
src/chart/boxplot/boxplotLayout.js
groupSeriesByAxis
function groupSeriesByAxis(ecModel) { var result = []; var axisList = []; ecModel.eachSeriesByType('boxplot', function (seriesModel) { var baseAxis = seriesModel.getBaseAxis(); var idx = zrUtil.indexOf(axisList, baseAxis); if (idx < 0) { idx = axisList.length; axisList[idx] = baseAxis; result[idx] = {axis: baseAxis, seriesModels: []}; } result[idx].seriesModels.push(seriesModel); }); return result; }
javascript
function groupSeriesByAxis(ecModel) { var result = []; var axisList = []; ecModel.eachSeriesByType('boxplot', function (seriesModel) { var baseAxis = seriesModel.getBaseAxis(); var idx = zrUtil.indexOf(axisList, baseAxis); if (idx < 0) { idx = axisList.length; axisList[idx] = baseAxis; result[idx] = {axis: baseAxis, seriesModels: []}; } result[idx].seriesModels.push(seriesModel); }); return result; }
[ "function", "groupSeriesByAxis", "(", "ecModel", ")", "{", "var", "result", "=", "[", "]", ";", "var", "axisList", "=", "[", "]", ";", "ecModel", ".", "eachSeriesByType", "(", "'boxplot'", ",", "function", "(", "seriesModel", ")", "{", "var", "baseAxis", ...
Group series by axis.
[ "Group", "series", "by", "axis", "." ]
4d0ea095dc3929cb6de40c45748826e7999c7aa8
https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/boxplot/boxplotLayout.js#L51-L69
train
group series by axis
[ 30522, 3853, 2967, 28077, 3762, 8528, 2483, 1006, 14925, 5302, 9247, 1007, 1063, 13075, 2765, 1027, 1031, 1033, 1025, 13075, 8123, 9863, 1027, 1031, 1033, 1025, 14925, 5302, 9247, 1012, 2169, 8043, 3111, 3762, 13874, 1006, 1005, 3482, 24759...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
aframevr/aframe
src/core/component.js
function (value, silent) { var schema = this.schema; if (this.isSingleProperty) { return parseProperty(value, schema); } return parseProperties(styleParser.parse(value), schema, true, this.name, silent); }
javascript
function (value, silent) { var schema = this.schema; if (this.isSingleProperty) { return parseProperty(value, schema); } return parseProperties(styleParser.parse(value), schema, true, this.name, silent); }
[ "function", "(", "value", ",", "silent", ")", "{", "var", "schema", "=", "this", ".", "schema", ";", "if", "(", "this", ".", "isSingleProperty", ")", "{", "return", "parseProperty", "(", "value", ",", "schema", ")", ";", "}", "return", "parseProperties",...
Parses each property based on property type. If component is single-property, then parses the single property value. @param {string} value - HTML attribute value. @param {boolean} silent - Suppress warning messages. @returns {object} Component data.
[ "Parses", "each", "property", "based", "on", "property", "type", ".", "If", "component", "is", "single", "-", "property", "then", "parses", "the", "single", "property", "value", "." ]
24acc78a7299a4cdfe3ef617f4d40ddf6275c992
https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/core/component.js#L157-L161
train
Parse the value
[ 30522, 3853, 1006, 3643, 1010, 4333, 1007, 1063, 13075, 8040, 28433, 1027, 2023, 1012, 8040, 28433, 1025, 2065, 1006, 2023, 1012, 26354, 2075, 2571, 21572, 4842, 3723, 1007, 1063, 2709, 11968, 3366, 21572, 4842, 3723, 1006, 3643, 1010, 8040...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/QuickOpen.js
beginSearch
function beginSearch(prefix, initialString) { function createDialog() { _curDialog = new QuickNavigateDialog(); _curDialog.showDialog(prefix, initialString); } if (_curDialog) { if (_curDialog.isOpen) { // Just start a search using the existing dialog. _curDialog.setSearchFieldValue(prefix, initialString); } else { // The dialog is already closing. Wait till it's done closing, // then open a new dialog. (Calling close() again returns the // promise for the deferred that was already kicked off when it // started closing.) _curDialog.close().done(createDialog); } } else { createDialog(); } }
javascript
function beginSearch(prefix, initialString) { function createDialog() { _curDialog = new QuickNavigateDialog(); _curDialog.showDialog(prefix, initialString); } if (_curDialog) { if (_curDialog.isOpen) { // Just start a search using the existing dialog. _curDialog.setSearchFieldValue(prefix, initialString); } else { // The dialog is already closing. Wait till it's done closing, // then open a new dialog. (Calling close() again returns the // promise for the deferred that was already kicked off when it // started closing.) _curDialog.close().done(createDialog); } } else { createDialog(); } }
[ "function", "beginSearch", "(", "prefix", ",", "initialString", ")", "{", "function", "createDialog", "(", ")", "{", "_curDialog", "=", "new", "QuickNavigateDialog", "(", ")", ";", "_curDialog", ".", "showDialog", "(", "prefix", ",", "initialString", ")", ";",...
Opens the Quick Open bar prepopulated with the given prefix (to select a mode) and optionally with the given query text too. Updates text field contents if Quick Open already open. @param {?string} prefix @param {?string} initialString
[ "Opens", "the", "Quick", "Open", "bar", "prepopulated", "with", "the", "given", "prefix", "(", "to", "select", "a", "mode", ")", "and", "optionally", "with", "the", "given", "query", "text", "too", ".", "Updates", "text", "field", "contents", "if", "Quick"...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/QuickOpen.js#L739-L759
train
Begin a search using the specified prefix and initialString.
[ 30522, 3853, 4269, 14644, 2818, 1006, 17576, 1010, 20381, 18886, 3070, 1007, 1063, 3853, 2580, 4818, 8649, 1006, 1007, 1063, 1035, 12731, 25070, 8649, 1027, 2047, 4248, 2532, 5737, 11644, 4818, 8649, 1006, 1007, 1025, 1035, 12731, 25070, 86...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js
templateExtensionPoint
function templateExtensionPoint(oElement, oWithControl) { var sValue = oElement.getAttribute("name"), // resolve name, no matter if CustomizingConfiguration is present! oPromise = getResolvedBinding(sValue, oElement, oWithControl, true); if (!oPromise) { return oSyncPromiseResolvedTrue; } return oPromise.then(function (sName) { var CustomizingConfiguration = sap.ui.require("sap/ui/core/CustomizingConfiguration"), oViewExtension; if (sName !== sValue) { // debug trace for dynamic names only debug(oElement, "name =", sName); } if (CustomizingConfiguration) { oViewExtension = CustomizingConfiguration.getViewExtension(sCurrentName, sName, oViewInfo.componentId); if (oViewExtension && oViewExtension.className === "sap.ui.core.Fragment" && oViewExtension.type === "XML") { return insertFragment(oViewExtension.fragmentName, oElement, oWithControl); } } return true; }, function (ex) { warn(oElement, 'Error in formatter:', ex); return true; }); }
javascript
function templateExtensionPoint(oElement, oWithControl) { var sValue = oElement.getAttribute("name"), // resolve name, no matter if CustomizingConfiguration is present! oPromise = getResolvedBinding(sValue, oElement, oWithControl, true); if (!oPromise) { return oSyncPromiseResolvedTrue; } return oPromise.then(function (sName) { var CustomizingConfiguration = sap.ui.require("sap/ui/core/CustomizingConfiguration"), oViewExtension; if (sName !== sValue) { // debug trace for dynamic names only debug(oElement, "name =", sName); } if (CustomizingConfiguration) { oViewExtension = CustomizingConfiguration.getViewExtension(sCurrentName, sName, oViewInfo.componentId); if (oViewExtension && oViewExtension.className === "sap.ui.core.Fragment" && oViewExtension.type === "XML") { return insertFragment(oViewExtension.fragmentName, oElement, oWithControl); } } return true; }, function (ex) { warn(oElement, 'Error in formatter:', ex); return true; }); }
[ "function", "templateExtensionPoint", "(", "oElement", ",", "oWithControl", ")", "{", "var", "sValue", "=", "oElement", ".", "getAttribute", "(", "\"name\"", ")", ",", "// resolve name, no matter if CustomizingConfiguration is present!", "oPromise", "=", "getResolvedBinding...
Replaces a <sap.ui.core:ExtensionPoint> element with the content of an XML fragment configured as a replacement (via component metadata, "customizing" and "sap.ui.viewExtensions"), or leaves it untouched in case no such replacement is currently configured. @param {Element} oElement the <sap.ui.core:ExtensionPoint> XML DOM element @param {sap.ui.core.util._with} oWithControl the parent's "with" control @returns {sap.ui.base.SyncPromise} A sync promise which resolves with <code>undefined</code> as soon as the <sap.ui.core:ExtensionPoint> element has been replaced and with <code>true</code> if there was no replacement
[ "Replaces", "a", "<sap", ".", "ui", ".", "core", ":", "ExtensionPoint", ">", "element", "with", "the", "content", "of", "an", "XML", "fragment", "configured", "as", "a", "replacement", "(", "via", "component", "metadata", "customizing", "and", "sap", ".", ...
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js#L1422-L1454
train
This function is called when the binding is resolved
[ 30522, 3853, 23561, 10288, 29048, 8400, 1006, 1051, 12260, 3672, 1010, 27593, 8939, 8663, 13181, 2140, 1007, 1063, 13075, 17917, 2389, 5657, 1027, 1051, 12260, 3672, 1012, 2131, 19321, 3089, 8569, 2618, 1006, 1000, 2171, 1000, 1007, 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...
KaTeX/KaTeX
dockers/texcmp/texcmp.js
execFile
function execFile(cmd, args, opts) { const deferred = Q.defer(); childProcess.execFile(cmd, args, opts, function(err, stdout, stderr) { if (err) { console.error("Error executing " + cmd + " " + args.join(" ")); console.error(stdout + stderr); err.stdout = stdout; err.stderr = stderr; deferred.reject(err); } else { deferred.resolve(stdout); } }); return deferred.promise; }
javascript
function execFile(cmd, args, opts) { const deferred = Q.defer(); childProcess.execFile(cmd, args, opts, function(err, stdout, stderr) { if (err) { console.error("Error executing " + cmd + " " + args.join(" ")); console.error(stdout + stderr); err.stdout = stdout; err.stderr = stderr; deferred.reject(err); } else { deferred.resolve(stdout); } }); return deferred.promise; }
[ "function", "execFile", "(", "cmd", ",", "args", ",", "opts", ")", "{", "const", "deferred", "=", "Q", ".", "defer", "(", ")", ";", "childProcess", ".", "execFile", "(", "cmd", ",", "args", ",", "opts", ",", "function", "(", "err", ",", "stdout", "...
Execute a given command, and return a promise to its output. Don't denodeify here, since fail branch needs access to stderr.
[ "Execute", "a", "given", "command", "and", "return", "a", "promise", "to", "its", "output", ".", "Don", "t", "denodeify", "here", "since", "fail", "branch", "needs", "access", "to", "stderr", "." ]
17bfb247b88070267f3e5c7b21fe4a360fdf49d9
https://github.com/KaTeX/KaTeX/blob/17bfb247b88070267f3e5c7b21fe4a360fdf49d9/dockers/texcmp/texcmp.js#L206-L220
train
Exec a command
[ 30522, 3853, 4654, 8586, 8873, 2571, 1006, 4642, 2094, 1010, 12098, 5620, 1010, 23569, 2015, 1007, 1063, 9530, 3367, 13366, 28849, 2094, 1027, 1053, 1012, 13366, 2121, 1006, 1007, 1025, 2775, 21572, 9623, 2015, 1012, 4654, 8586, 8873, 2571,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SheetJS/js-xlsx
bits/28_binstructs.js
parse_XLSBCell
function parse_XLSBCell(data)/*:any*/ { var col = data.read_shift(4); var iStyleRef = data.read_shift(2); iStyleRef += data.read_shift(1) <<16; data.l++; //var fPhShow = data.read_shift(1); return { c:col, iStyleRef: iStyleRef }; }
javascript
function parse_XLSBCell(data)/*:any*/ { var col = data.read_shift(4); var iStyleRef = data.read_shift(2); iStyleRef += data.read_shift(1) <<16; data.l++; //var fPhShow = data.read_shift(1); return { c:col, iStyleRef: iStyleRef }; }
[ "function", "parse_XLSBCell", "(", "data", ")", "/*:any*/", "{", "var", "col", "=", "data", ".", "read_shift", "(", "4", ")", ";", "var", "iStyleRef", "=", "data", ".", "read_shift", "(", "2", ")", ";", "iStyleRef", "+=", "data", ".", "read_shift", "("...
/* [MS-XLSB] 2.5.9
[ "/", "*", "[", "MS", "-", "XLSB", "]", "2", ".", "5", ".", "9" ]
9a6d8a1d3d80c78dad5201fb389316f935279cdc
https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/bits/28_binstructs.js#L70-L76
train
Parse an XLSBCell
[ 30522, 3853, 11968, 3366, 1035, 28712, 19022, 29109, 2140, 1006, 2951, 1007, 1013, 1008, 1024, 2151, 1008, 1013, 1063, 13075, 8902, 1027, 2951, 1012, 3191, 1035, 5670, 1006, 1018, 1007, 1025, 13075, 21541, 20853, 12879, 1027, 2951, 1012, 31...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.support/src/sap/ui/support/supportRules/ui/external/Highlighter.js
function (elementId) { var highlighter; var targetDomElement; var targetRect; if (_highLighter === null && !document.getElementById("ui5-highlighter")) { _createHighLighter(); } else { _showHighLighter(); } highlighter = _highLighter.firstElementChild; targetDomElement = document.getElementById(elementId); if (targetDomElement) { targetRect = targetDomElement.getBoundingClientRect(); highlighter.style.top = targetRect.top + "px"; highlighter.style.left = targetRect.left + "px"; highlighter.style.height = targetRect.height + "px"; highlighter.style.width = targetRect.width + "px"; } return this; }
javascript
function (elementId) { var highlighter; var targetDomElement; var targetRect; if (_highLighter === null && !document.getElementById("ui5-highlighter")) { _createHighLighter(); } else { _showHighLighter(); } highlighter = _highLighter.firstElementChild; targetDomElement = document.getElementById(elementId); if (targetDomElement) { targetRect = targetDomElement.getBoundingClientRect(); highlighter.style.top = targetRect.top + "px"; highlighter.style.left = targetRect.left + "px"; highlighter.style.height = targetRect.height + "px"; highlighter.style.width = targetRect.width + "px"; } return this; }
[ "function", "(", "elementId", ")", "{", "var", "highlighter", ";", "var", "targetDomElement", ";", "var", "targetRect", ";", "if", "(", "_highLighter", "===", "null", "&&", "!", "document", ".", "getElementById", "(", "\"ui5-highlighter\"", ")", ")", "{", "_...
Set the position of the visual highlighter. @param {string} elementId - The id of the DOM element that need to be highlighted @returns {exports}
[ "Set", "the", "position", "of", "the", "visual", "highlighter", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.support/src/sap/ui/support/supportRules/ui/external/Highlighter.js#L62-L86
train
Creates the highlighter element for the given elementId.
[ 30522, 3853, 1006, 5783, 3593, 1007, 1063, 13075, 12944, 2121, 1025, 13075, 4539, 26173, 16930, 4765, 1025, 13075, 4539, 2890, 6593, 1025, 2065, 1006, 1035, 12944, 2121, 1027, 1027, 1027, 19701, 1004, 1004, 999, 6254, 1012, 2131, 12260, 367...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
uber/deck.gl
modules/core/src/lifecycle/prop-types.js
parsePropType
function parsePropType(name, propDef) { switch (getTypeOf(propDef)) { case 'object': return normalizePropDefinition(name, propDef); case 'array': return normalizePropDefinition(name, {type: 'array', value: propDef, compare: false}); case 'boolean': return normalizePropDefinition(name, {type: 'boolean', value: propDef}); case 'number': return normalizePropDefinition(name, {type: 'number', value: propDef}); case 'function': return normalizePropDefinition(name, {type: 'function', value: propDef, compare: true}); // return guessFunctionType(name, propDef); default: return {name, type: 'unknown', value: propDef}; } }
javascript
function parsePropType(name, propDef) { switch (getTypeOf(propDef)) { case 'object': return normalizePropDefinition(name, propDef); case 'array': return normalizePropDefinition(name, {type: 'array', value: propDef, compare: false}); case 'boolean': return normalizePropDefinition(name, {type: 'boolean', value: propDef}); case 'number': return normalizePropDefinition(name, {type: 'number', value: propDef}); case 'function': return normalizePropDefinition(name, {type: 'function', value: propDef, compare: true}); // return guessFunctionType(name, propDef); default: return {name, type: 'unknown', value: propDef}; } }
[ "function", "parsePropType", "(", "name", ",", "propDef", ")", "{", "switch", "(", "getTypeOf", "(", "propDef", ")", ")", "{", "case", "'object'", ":", "return", "normalizePropDefinition", "(", "name", ",", "propDef", ")", ";", "case", "'array'", ":", "ret...
Parses one property definition entry. Either contains: * a valid prop type object ({type, ...}) * or just a default value, in which case type and name inference is used
[ "Parses", "one", "property", "definition", "entry", ".", "Either", "contains", ":", "*", "a", "valid", "prop", "type", "object", "(", "{", "type", "...", "}", ")", "*", "or", "just", "a", "default", "value", "in", "which", "case", "type", "and", "name"...
a2010448b7f268bbd03617b812334c68a6b9e5b2
https://github.com/uber/deck.gl/blob/a2010448b7f268bbd03617b812334c68a6b9e5b2/modules/core/src/lifecycle/prop-types.js#L98-L119
train
Parse the type of a property definition
[ 30522, 3853, 11968, 3366, 21572, 13876, 18863, 1006, 2171, 1010, 17678, 3207, 2546, 1007, 1063, 6942, 1006, 2131, 13874, 11253, 1006, 17678, 3207, 2546, 1007, 1007, 1063, 2553, 1005, 4874, 1005, 1024, 2709, 3671, 4697, 21572, 17299, 12879, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/max-lines-per-function.js
isFullLineComment
function isFullLineComment(line, lineNumber, comment) { const start = comment.loc.start, end = comment.loc.end, isFirstTokenOnLine = start.line === lineNumber && !line.slice(0, start.column).trim(), isLastTokenOnLine = end.line === lineNumber && !line.slice(end.column).trim(); return comment && (start.line < lineNumber || isFirstTokenOnLine) && (end.line > lineNumber || isLastTokenOnLine); }
javascript
function isFullLineComment(line, lineNumber, comment) { const start = comment.loc.start, end = comment.loc.end, isFirstTokenOnLine = start.line === lineNumber && !line.slice(0, start.column).trim(), isLastTokenOnLine = end.line === lineNumber && !line.slice(end.column).trim(); return comment && (start.line < lineNumber || isFirstTokenOnLine) && (end.line > lineNumber || isLastTokenOnLine); }
[ "function", "isFullLineComment", "(", "line", ",", "lineNumber", ",", "comment", ")", "{", "const", "start", "=", "comment", ".", "loc", ".", "start", ",", "end", "=", "comment", ".", "loc", ".", "end", ",", "isFirstTokenOnLine", "=", "start", ".", "line...
-------------------------------------------------------------------------- Helpers -------------------------------------------------------------------------- Tells if a comment encompasses the entire line. @param {string} line The source line with a trailing comment @param {number} lineNumber The one-indexed line number this is on @param {ASTNode} comment The comment to remove @returns {boolean} If the comment covers the entire line
[ "--------------------------------------------------------------------------", "Helpers", "--------------------------------------------------------------------------", "Tells", "if", "a", "comment", "encompasses", "the", "entire", "line", "." ]
bc0819c94aad14f7fad3cbc2338ea15658b0f272
https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/max-lines-per-function.js#L121-L130
train
Check if a comment is full line
[ 30522, 3853, 2003, 3993, 21202, 8586, 5358, 3672, 1006, 2240, 1010, 17517, 29440, 1010, 7615, 1007, 1063, 9530, 3367, 2707, 1027, 7615, 1012, 8840, 2278, 1012, 2707, 1010, 2203, 1027, 7615, 1012, 8840, 2278, 1012, 2203, 1010, 2003, 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...
jquery/jquery
build/release/ensure-sizzle.js
ensureSizzle
function ensureSizzle( Release, callback ) { console.log(); console.log( "Checking Sizzle version..." ); getLatestSizzle( function( latest ) { var match = rversion.exec( fs.readFileSync( sizzleLoc, "utf8" ) ), version = match ? match[ 1 ] : "Not Found"; if ( version !== latest ) { // colors is inherited from jquery-release console.log( "The Sizzle version in the src folder (" + chalk.red( version ) + ") is not the latest tag (" + chalk.green( latest ) + ")." ); Release.confirm( callback ); } else { console.log( "Sizzle is latest (" + chalk.green( latest ) + ")" ); callback(); } } ); }
javascript
function ensureSizzle( Release, callback ) { console.log(); console.log( "Checking Sizzle version..." ); getLatestSizzle( function( latest ) { var match = rversion.exec( fs.readFileSync( sizzleLoc, "utf8" ) ), version = match ? match[ 1 ] : "Not Found"; if ( version !== latest ) { // colors is inherited from jquery-release console.log( "The Sizzle version in the src folder (" + chalk.red( version ) + ") is not the latest tag (" + chalk.green( latest ) + ")." ); Release.confirm( callback ); } else { console.log( "Sizzle is latest (" + chalk.green( latest ) + ")" ); callback(); } } ); }
[ "function", "ensureSizzle", "(", "Release", ",", "callback", ")", "{", "console", ".", "log", "(", ")", ";", "console", ".", "log", "(", "\"Checking Sizzle version...\"", ")", ";", "getLatestSizzle", "(", "function", "(", "latest", ")", "{", "var", "match", ...
Ensure the /src folder has the latest tag of Sizzle @param {Object} Release @param {Function} callback
[ "Ensure", "the", "/", "src", "folder", "has", "the", "latest", "tag", "of", "Sizzle" ]
ccbd6b93424cbdbf86f07a86c2e55cbab497d7a3
https://github.com/jquery/jquery/blob/ccbd6b93424cbdbf86f07a86c2e55cbab497d7a3/build/release/ensure-sizzle.js#L30-L50
train
Ensure Sizzle is the latest version of the release
[ 30522, 3853, 21312, 10993, 29247, 1006, 2713, 1010, 2655, 5963, 1007, 1063, 10122, 1012, 8833, 1006, 1007, 1025, 10122, 1012, 8833, 1006, 1000, 9361, 9033, 17644, 2544, 1012, 1012, 1012, 30524, 8873, 4244, 6038, 2278, 1006, 9033, 17644, 413...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
aframevr/aframe
src/core/a-register-element.js
wrapANodeMethods
function wrapANodeMethods (obj) { var newObj = {}; var ANodeMethods = [ 'attachedCallback', 'attributeChangedCallback', 'createdCallback', 'detachedCallback' ]; wrapMethods(newObj, ANodeMethods, obj, ANode.prototype); copyProperties(obj, newObj); return newObj; }
javascript
function wrapANodeMethods (obj) { var newObj = {}; var ANodeMethods = [ 'attachedCallback', 'attributeChangedCallback', 'createdCallback', 'detachedCallback' ]; wrapMethods(newObj, ANodeMethods, obj, ANode.prototype); copyProperties(obj, newObj); return newObj; }
[ "function", "wrapANodeMethods", "(", "obj", ")", "{", "var", "newObj", "=", "{", "}", ";", "var", "ANodeMethods", "=", "[", "'attachedCallback'", ",", "'attributeChangedCallback'", ",", "'createdCallback'", ",", "'detachedCallback'", "]", ";", "wrapMethods", "(", ...
Wrap some obj methods to call those on `ANode` base prototype. @param {object} obj - Object that contains the methods that will be wrapped. @return {object} An object with the same properties as the input parameter but with some of methods wrapped.
[ "Wrap", "some", "obj", "methods", "to", "call", "those", "on", "ANode", "base", "prototype", "." ]
24acc78a7299a4cdfe3ef617f4d40ddf6275c992
https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/core/a-register-element.js#L79-L90
train
ANode. prototype. attachCallback attachAttributeChangedCallback attachCreatedCallback detachAttachedCallback
[ 30522, 3853, 10236, 6761, 3207, 11368, 6806, 5104, 1006, 27885, 3501, 1007, 1063, 13075, 2047, 16429, 3501, 1027, 1063, 1065, 1025, 13075, 2019, 10244, 11368, 6806, 5104, 1027, 1031, 1005, 4987, 9289, 20850, 8684, 1005, 1010, 1005, 17961, 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...
electron/electron
lib/sandboxed_renderer/init.js
preloadRequire
function preloadRequire (module) { if (loadedModules.has(module)) { return loadedModules.get(module) } throw new Error(`module not found: ${module}`) }
javascript
function preloadRequire (module) { if (loadedModules.has(module)) { return loadedModules.get(module) } throw new Error(`module not found: ${module}`) }
[ "function", "preloadRequire", "(", "module", ")", "{", "if", "(", "loadedModules", ".", "has", "(", "module", ")", ")", "{", "return", "loadedModules", ".", "get", "(", "module", ")", "}", "throw", "new", "Error", "(", "`", "${", "module", "}", "`", ...
This is the `require` function that will be visible to the preload script
[ "This", "is", "the", "require", "function", "that", "will", "be", "visible", "to", "the", "preload", "script" ]
6e29611788277729647acf465f10db1ea6f15788
https://github.com/electron/electron/blob/6e29611788277729647acf465f10db1ea6f15788/lib/sandboxed_renderer/init.js#L99-L104
train
Preload a module
[ 30522, 3853, 3653, 11066, 2890, 15549, 2890, 1006, 11336, 1007, 1063, 2065, 1006, 8209, 5302, 8566, 4244, 1012, 2038, 1006, 11336, 1007, 1007, 1063, 2709, 8209, 5302, 8566, 4244, 1012, 2131, 1006, 11336, 1007, 1065, 5466, 2047, 7561, 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...
cytoscape/cytoscape.js
dist/cytoscape.esm.js
headlessStep
function headlessStep() { if (!cy._private.animationsRunning) { return; } requestAnimationFrame(function animationStep(now$$1) { stepAll(now$$1, cy); headlessStep(); }); }
javascript
function headlessStep() { if (!cy._private.animationsRunning) { return; } requestAnimationFrame(function animationStep(now$$1) { stepAll(now$$1, cy); headlessStep(); }); }
[ "function", "headlessStep", "(", ")", "{", "if", "(", "!", "cy", ".", "_private", ".", "animationsRunning", ")", "{", "return", ";", "}", "requestAnimationFrame", "(", "function", "animationStep", "(", "now$$1", ")", "{", "stepAll", "(", "now$$1", ",", "cy...
save cycles when no style used NB the animation loop will exec in headless environments if style enabled and explicit cy.destroy() is necessary to stop the loop
[ "save", "cycles", "when", "no", "style", "used", "NB", "the", "animation", "loop", "will", "exec", "in", "headless", "environments", "if", "style", "enabled", "and", "explicit", "cy", ".", "destroy", "()", "is", "necessary", "to", "stop", "the", "loop" ]
ad2051b65e2243cfd953d8b24a8bf95bfa8559e5
https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L13353-L13362
train
headlessStep - headless animation
[ 30522, 3853, 2132, 3238, 13473, 2361, 1006, 1007, 1063, 2065, 1006, 999, 22330, 1012, 1035, 2797, 1012, 7284, 21338, 4609, 5582, 1007, 1063, 2709, 1025, 1065, 5227, 7088, 28649, 15643, 1006, 3853, 7284, 13473, 2361, 1006, 2085, 1002, 1002, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/apps/amp/lib/router.js
getPostData
function getPostData(req, res, next) { req.body = req.body || {}; const urlWithoutSubdirectoryWithoutAmp = res.locals.relativeUrl.match(/(.*?\/)amp\/?$/)[1]; /** * @NOTE * * We have to figure out the target permalink, otherwise it would be possible to serve a post * which lives in two collections. * * @TODO: * * This is not optimal and caused by the fact how apps currently work. But apps weren't designed * for dynamic routing. * * I think if the responsible, target router would first take care fetching/determining the post, the * request could then be forwarded to this app. Then we don't have to: * * 1. care about fetching the post * 2. care about if the post can be served * 3. then this app would act like an extension * * The challenge is to design different types of apps e.g. extensions of routers, standalone pages etc. */ const permalinks = urlService.getPermalinkByUrl(urlWithoutSubdirectoryWithoutAmp, {withUrlOptions: true}); if (!permalinks) { return next(new common.errors.NotFoundError({ message: common.i18n.t('errors.errors.pageNotFound') })); } // @NOTE: amp is not supported for static pages // @TODO: https://github.com/TryGhost/Ghost/issues/10548 helpers.entryLookup(urlWithoutSubdirectoryWithoutAmp, {permalinks, query: {controller: 'postsPublic', resource: 'posts'}}, res.locals) .then((result) => { if (result && result.entry) { req.body.post = result.entry; } next(); }) .catch(next); }
javascript
function getPostData(req, res, next) { req.body = req.body || {}; const urlWithoutSubdirectoryWithoutAmp = res.locals.relativeUrl.match(/(.*?\/)amp\/?$/)[1]; /** * @NOTE * * We have to figure out the target permalink, otherwise it would be possible to serve a post * which lives in two collections. * * @TODO: * * This is not optimal and caused by the fact how apps currently work. But apps weren't designed * for dynamic routing. * * I think if the responsible, target router would first take care fetching/determining the post, the * request could then be forwarded to this app. Then we don't have to: * * 1. care about fetching the post * 2. care about if the post can be served * 3. then this app would act like an extension * * The challenge is to design different types of apps e.g. extensions of routers, standalone pages etc. */ const permalinks = urlService.getPermalinkByUrl(urlWithoutSubdirectoryWithoutAmp, {withUrlOptions: true}); if (!permalinks) { return next(new common.errors.NotFoundError({ message: common.i18n.t('errors.errors.pageNotFound') })); } // @NOTE: amp is not supported for static pages // @TODO: https://github.com/TryGhost/Ghost/issues/10548 helpers.entryLookup(urlWithoutSubdirectoryWithoutAmp, {permalinks, query: {controller: 'postsPublic', resource: 'posts'}}, res.locals) .then((result) => { if (result && result.entry) { req.body.post = result.entry; } next(); }) .catch(next); }
[ "function", "getPostData", "(", "req", ",", "res", ",", "next", ")", "{", "req", ".", "body", "=", "req", ".", "body", "||", "{", "}", ";", "const", "urlWithoutSubdirectoryWithoutAmp", "=", "res", ".", "locals", ".", "relativeUrl", ".", "match", "(", "...
This here is a controller. In fact, this whole file is nothing more than a controller + renderer & doesn't need to be a router
[ "This", "here", "is", "a", "controller", ".", "In", "fact", "this", "whole", "file", "is", "nothing", "more", "than", "a", "controller", "+", "renderer", "&", "doesn", "t", "need", "to", "be", "a", "router" ]
bb7bb55cf3e60af99ebbc56099928827b58461bc
https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/apps/amp/lib/router.js#L33-L77
train
Get the post data from the post service
[ 30522, 3853, 2131, 19894, 2850, 2696, 1006, 2128, 4160, 1010, 24501, 1010, 2279, 1007, 1063, 2128, 4160, 1012, 2303, 1027, 2128, 4160, 1012, 2303, 1064, 1064, 1063, 1065, 1025, 9530, 3367, 24471, 2140, 24415, 12166, 12083, 4305, 2890, 16761...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/View.js
function () { var roamTransformable = this._roamTransformable; var rawTransformable = this._rawTransformable; rawTransformable.parent = roamTransformable; roamTransformable.updateTransform(); rawTransformable.updateTransform(); matrix.copy(this.transform || (this.transform = []), rawTransformable.transform || matrix.create()); this._rawTransform = rawTransformable.getLocalTransform(); this.invTransform = this.invTransform || []; matrix.invert(this.invTransform, this.transform); this.decomposeTransform(); }
javascript
function () { var roamTransformable = this._roamTransformable; var rawTransformable = this._rawTransformable; rawTransformable.parent = roamTransformable; roamTransformable.updateTransform(); rawTransformable.updateTransform(); matrix.copy(this.transform || (this.transform = []), rawTransformable.transform || matrix.create()); this._rawTransform = rawTransformable.getLocalTransform(); this.invTransform = this.invTransform || []; matrix.invert(this.invTransform, this.transform); this.decomposeTransform(); }
[ "function", "(", ")", "{", "var", "roamTransformable", "=", "this", ".", "_roamTransformable", ";", "var", "rawTransformable", "=", "this", ".", "_rawTransformable", ";", "rawTransformable", ".", "parent", "=", "roamTransformable", ";", "roamTransformable", ".", "...
Update transform from roam and mapLocation @private
[ "Update", "transform", "from", "roam", "and", "mapLocation" ]
4d0ea095dc3929cb6de40c45748826e7999c7aa8
https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/coord/View.js#L214-L230
train
update roamTransformable and rawTransformable
[ 30522, 3853, 1006, 1007, 1063, 13075, 25728, 6494, 3619, 14192, 3085, 1027, 2023, 1012, 1035, 25728, 6494, 3619, 14192, 3085, 1025, 13075, 6315, 6494, 3619, 14192, 3085, 1027, 2023, 1012, 1035, 6315, 6494, 3619, 14192, 3085, 1025, 6315, 649...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jiahaog/nativefier
src/build/buildMain.js
maybeNoIconOption
function maybeNoIconOption(options) { const packageOptions = JSON.parse(JSON.stringify(options)); if (options.platform === 'win32' && !isWindows()) { if (!hasBinary.sync('wine')) { log.warn( 'Wine is required to set the icon for a Windows app when packaging on non-windows platforms', ); packageOptions.icon = null; } } return packageOptions; }
javascript
function maybeNoIconOption(options) { const packageOptions = JSON.parse(JSON.stringify(options)); if (options.platform === 'win32' && !isWindows()) { if (!hasBinary.sync('wine')) { log.warn( 'Wine is required to set the icon for a Windows app when packaging on non-windows platforms', ); packageOptions.icon = null; } } return packageOptions; }
[ "function", "maybeNoIconOption", "(", "options", ")", "{", "const", "packageOptions", "=", "JSON", ".", "parse", "(", "JSON", ".", "stringify", "(", "options", ")", ")", ";", "if", "(", "options", ".", "platform", "===", "'win32'", "&&", "!", "isWindows", ...
Removes the `icon` parameter from options if building for Windows while not on Windows and Wine is not installed @param options
[ "Removes", "the", "icon", "parameter", "from", "options", "if", "building", "for", "Windows", "while", "not", "on", "Windows", "and", "Wine", "is", "not", "installed" ]
b959956a38ce51a9dd95d42308f0a6c66489b624
https://github.com/jiahaog/nativefier/blob/b959956a38ce51a9dd95d42308f0a6c66489b624/src/build/buildMain.js#L45-L56
train
If the platform is not Windows then we need to set the icon to null
[ 30522, 3853, 2672, 3630, 28524, 7361, 3508, 1006, 7047, 1007, 1063, 9530, 3367, 7427, 7361, 9285, 1027, 1046, 3385, 1012, 11968, 3366, 1006, 1046, 3385, 1012, 5164, 8757, 1006, 7047, 1007, 1007, 1025, 2065, 1006, 7047, 1012, 4132, 1027, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/LiveDevelopment/Agents/EditAgent.js
_onCharacterDataModified
function _onCharacterDataModified(event, res) { // res = {nodeId, characterData} if (_editedNode.nodeId !== res.nodeId) { return; } GotoAgent.open(DOMAgent.url); var editor = EditorManager.getCurrentFullEditor(); var codeMirror = editor._codeMirror; var change = _findChangedCharacters(_editedNode.value, res.characterData); if (change) { var from = codeMirror.posFromIndex(_editedNode.location + change.from); var to = codeMirror.posFromIndex(_editedNode.location + change.to); exports.isEditing = true; editor.document.replaceRange(change.text, from, to); exports.isEditing = false; var newPos = codeMirror.posFromIndex(_editedNode.location + change.from + change.text.length); editor.setCursorPos(newPos.line, newPos.ch); } }
javascript
function _onCharacterDataModified(event, res) { // res = {nodeId, characterData} if (_editedNode.nodeId !== res.nodeId) { return; } GotoAgent.open(DOMAgent.url); var editor = EditorManager.getCurrentFullEditor(); var codeMirror = editor._codeMirror; var change = _findChangedCharacters(_editedNode.value, res.characterData); if (change) { var from = codeMirror.posFromIndex(_editedNode.location + change.from); var to = codeMirror.posFromIndex(_editedNode.location + change.to); exports.isEditing = true; editor.document.replaceRange(change.text, from, to); exports.isEditing = false; var newPos = codeMirror.posFromIndex(_editedNode.location + change.from + change.text.length); editor.setCursorPos(newPos.line, newPos.ch); } }
[ "function", "_onCharacterDataModified", "(", "event", ",", "res", ")", "{", "// res = {nodeId, characterData}", "if", "(", "_editedNode", ".", "nodeId", "!==", "res", ".", "nodeId", ")", "{", "return", ";", "}", "GotoAgent", ".", "open", "(", "DOMAgent", ".", ...
WebInspector Event: DOM.characterDataModified
[ "WebInspector", "Event", ":", "DOM", ".", "characterDataModified" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/EditAgent.js#L76-L96
train
onCharacterDataModified - On character data modification
[ 30522, 3853, 1035, 2006, 7507, 22648, 3334, 2850, 15464, 7716, 7810, 1006, 2724, 1010, 24501, 1007, 1063, 1013, 1013, 24501, 1027, 1063, 13045, 3593, 1010, 2839, 2850, 2696, 1065, 2065, 1006, 1035, 5493, 3630, 3207, 1012, 13045, 3593, 999, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/JSUtils/ScopeManager.js
getOffset
function getOffset(session, fileInfo, offset) { var newOffset; if (offset) { newOffset = {line: offset.line, ch: offset.ch}; } else { newOffset = session.getCursor(); } if (fileInfo.type === MessageIds.TERN_FILE_INFO_TYPE_PART) { newOffset.line = Math.max(0, newOffset.line - fileInfo.offsetLines); } return newOffset; }
javascript
function getOffset(session, fileInfo, offset) { var newOffset; if (offset) { newOffset = {line: offset.line, ch: offset.ch}; } else { newOffset = session.getCursor(); } if (fileInfo.type === MessageIds.TERN_FILE_INFO_TYPE_PART) { newOffset.line = Math.max(0, newOffset.line - fileInfo.offsetLines); } return newOffset; }
[ "function", "getOffset", "(", "session", ",", "fileInfo", ",", "offset", ")", "{", "var", "newOffset", ";", "if", "(", "offset", ")", "{", "newOffset", "=", "{", "line", ":", "offset", ".", "line", ",", "ch", ":", "offset", ".", "ch", "}", ";", "}"...
Get the current offset. The offset is adjusted for "part" updates. @param {!Session} session - the current session @param {{type: string, name: string, offsetLines: number, text: string}} fileInfo - type of update, name of file, and the text of the update. For "full" updates, the whole text of the file is present. For "part" updates, the changed portion of the text. For "empty" updates, the file has not been modified and the text is empty. @param {{line: number, ch: number}=} offset - the default offset (optional). Will use the cursor if not provided. @return {{line: number, ch: number}}
[ "Get", "the", "current", "offset", ".", "The", "offset", "is", "adjusted", "for", "part", "updates", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L636-L650
train
Get offset of file
[ 30522, 3853, 2131, 27475, 3388, 1006, 5219, 1010, 5371, 2378, 14876, 1010, 16396, 1007, 1063, 13075, 2047, 27475, 3388, 1025, 2065, 1006, 16396, 1007, 1063, 2047, 27475, 3388, 1027, 1063, 2240, 1024, 16396, 1012, 2240, 1010, 10381, 1024, 16...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
graphql/graphql-js
src/utilities/schemaPrinter.js
isSchemaOfCommonNames
function isSchemaOfCommonNames(schema: GraphQLSchema): boolean { const queryType = schema.getQueryType(); if (queryType && queryType.name !== 'Query') { return false; } const mutationType = schema.getMutationType(); if (mutationType && mutationType.name !== 'Mutation') { return false; } const subscriptionType = schema.getSubscriptionType(); if (subscriptionType && subscriptionType.name !== 'Subscription') { return false; } return true; }
javascript
function isSchemaOfCommonNames(schema: GraphQLSchema): boolean { const queryType = schema.getQueryType(); if (queryType && queryType.name !== 'Query') { return false; } const mutationType = schema.getMutationType(); if (mutationType && mutationType.name !== 'Mutation') { return false; } const subscriptionType = schema.getSubscriptionType(); if (subscriptionType && subscriptionType.name !== 'Subscription') { return false; } return true; }
[ "function", "isSchemaOfCommonNames", "(", "schema", ":", "GraphQLSchema", ")", ":", "boolean", "{", "const", "queryType", "=", "schema", ".", "getQueryType", "(", ")", ";", "if", "(", "queryType", "&&", "queryType", ".", "name", "!==", "'Query'", ")", "{", ...
GraphQL schema define root types for each type of operation. These types are the same as any other type and can be named in any manner, however there is a common naming convention: schema { query: Query mutation: Mutation } When using this naming convention, the schema description can be omitted.
[ "GraphQL", "schema", "define", "root", "types", "for", "each", "type", "of", "operation", ".", "These", "types", "are", "the", "same", "as", "any", "other", "type", "and", "can", "be", "named", "in", "any", "manner", "however", "there", "is", "a", "commo...
b65ff6db8893c1c68f0f236c4b2d663e6c55f5ef
https://github.com/graphql/graphql-js/blob/b65ff6db8893c1c68f0f236c4b2d663e6c55f5ef/src/utilities/schemaPrinter.js#L144-L161
train
Returns true if the schema is of common names
[ 30522, 3853, 26354, 5403, 2863, 11253, 9006, 8202, 18442, 2015, 1006, 8040, 28433, 1024, 10629, 4160, 4877, 5403, 2863, 1007, 1024, 22017, 20898, 1063, 9530, 3367, 23032, 13874, 1027, 8040, 28433, 1012, 2131, 4226, 2854, 13874, 1006, 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
lib/jsdoc/transform-apijson-for-sdk.js
function (description, since) { var result = description || ""; if (since) { result += '<br><br><i>Since: ' + since + '.</i>'; } result = this._preProcessLinksInTextBlock(result); return result; }
javascript
function (description, since) { var result = description || ""; if (since) { result += '<br><br><i>Since: ' + since + '.</i>'; } result = this._preProcessLinksInTextBlock(result); return result; }
[ "function", "(", "description", ",", "since", ")", "{", "var", "result", "=", "description", "||", "\"\"", ";", "if", "(", "since", ")", "{", "result", "+=", "'<br><br><i>Since: '", "+", "since", "+", "'.</i>'", ";", "}", "result", "=", "this", ".", "_...
Formats the description of control properties @param description - the description of the property @param since - the since version information of the property @returns string - the formatted description
[ "Formats", "the", "description", "of", "control", "properties" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/lib/jsdoc/transform-apijson-for-sdk.js#L1084-L1093
train
Returns a string with the description of the link
[ 30522, 3853, 1006, 6412, 1010, 2144, 1007, 1063, 13075, 2765, 1027, 6412, 1064, 1064, 1000, 1000, 1025, 2065, 1006, 2144, 1007, 1063, 2765, 1009, 1027, 1005, 1026, 7987, 1028, 1026, 7987, 1028, 1026, 1045, 1028, 2144, 1024, 1005, 1009, 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...
eslint/eslint
lib/rules/require-atomic-updates.js
resolveVariable
function resolveVariable(identifier) { if (!resolvedVariableCache.has(identifier)) { const surroundingScope = getScope(identifier); if (surroundingScope) { resolvedVariableCache.set(identifier, resolveVariableInScope(identifier, surroundingScope)); } else { resolvedVariableCache.set(identifier, null); } } return resolvedVariableCache.get(identifier); }
javascript
function resolveVariable(identifier) { if (!resolvedVariableCache.has(identifier)) { const surroundingScope = getScope(identifier); if (surroundingScope) { resolvedVariableCache.set(identifier, resolveVariableInScope(identifier, surroundingScope)); } else { resolvedVariableCache.set(identifier, null); } } return resolvedVariableCache.get(identifier); }
[ "function", "resolveVariable", "(", "identifier", ")", "{", "if", "(", "!", "resolvedVariableCache", ".", "has", "(", "identifier", ")", ")", "{", "const", "surroundingScope", "=", "getScope", "(", "identifier", ")", ";", "if", "(", "surroundingScope", ")", ...
Resolves an identifier to a variable @param {ASTNode} identifier An identifier node @returns {Variable|null} The escope Variable that uses this identifier
[ "Resolves", "an", "identifier", "to", "a", "variable" ]
bc0819c94aad14f7fad3cbc2338ea15658b0f272
https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/require-atomic-updates.js#L75-L87
train
Resolves a variable in the scope of the given identifier.
[ 30522, 3853, 10663, 10755, 19210, 1006, 8909, 4765, 18095, 1007, 1063, 2065, 1006, 999, 10395, 10755, 19210, 3540, 5403, 1012, 2038, 1006, 8909, 4765, 18095, 1007, 1007, 1063, 9530, 3367, 11301, 16186, 1027, 4152, 16186, 1006, 8909, 4765, 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/CodeHintList.js
CodeHintList
function CodeHintList(editor, insertHintOnTab, maxResults) { /** * The list of hints to display * * @type {Array.<string|jQueryObject>} */ this.hints = []; /** * The selected position in the list; otherwise -1. * * @type {number} */ this.selectedIndex = -1; /** * The maximum number of hints to display. Can be overriden via maxCodeHints pref * * @type {number} */ this.maxResults = ValidationUtils.isIntegerInRange(maxResults, 1, 1000) ? maxResults : 50; /** * Is the list currently open? * * @type {boolean} */ this.opened = false; /** * The editor context * * @type {Editor} */ this.editor = editor; /** * Whether the currently selected hint should be inserted on a tab key event * * @type {boolean} */ this.insertHintOnTab = insertHintOnTab; /** * Pending text insertion * * @type {string} */ this.pendingText = ""; /** * The hint selection callback function * * @type {Function} */ this.handleSelect = null; /** * The hint list closure callback function * * @type {Function} */ this.handleClose = null; /** * The hint list menu object * * @type {jQuery.Object} */ this.$hintMenu = $("<li class='dropdown codehint-menu'></li>") .append($("<a href='#' class='dropdown-toggle' data-toggle='dropdown'></a>") .hide()) .append("<ul class='dropdown-menu'></ul>"); this._keydownHook = this._keydownHook.bind(this); }
javascript
function CodeHintList(editor, insertHintOnTab, maxResults) { /** * The list of hints to display * * @type {Array.<string|jQueryObject>} */ this.hints = []; /** * The selected position in the list; otherwise -1. * * @type {number} */ this.selectedIndex = -1; /** * The maximum number of hints to display. Can be overriden via maxCodeHints pref * * @type {number} */ this.maxResults = ValidationUtils.isIntegerInRange(maxResults, 1, 1000) ? maxResults : 50; /** * Is the list currently open? * * @type {boolean} */ this.opened = false; /** * The editor context * * @type {Editor} */ this.editor = editor; /** * Whether the currently selected hint should be inserted on a tab key event * * @type {boolean} */ this.insertHintOnTab = insertHintOnTab; /** * Pending text insertion * * @type {string} */ this.pendingText = ""; /** * The hint selection callback function * * @type {Function} */ this.handleSelect = null; /** * The hint list closure callback function * * @type {Function} */ this.handleClose = null; /** * The hint list menu object * * @type {jQuery.Object} */ this.$hintMenu = $("<li class='dropdown codehint-menu'></li>") .append($("<a href='#' class='dropdown-toggle' data-toggle='dropdown'></a>") .hide()) .append("<ul class='dropdown-menu'></ul>"); this._keydownHook = this._keydownHook.bind(this); }
[ "function", "CodeHintList", "(", "editor", ",", "insertHintOnTab", ",", "maxResults", ")", "{", "/**\n * The list of hints to display\n *\n * @type {Array.<string|jQueryObject>}\n */", "this", ".", "hints", "=", "[", "]", ";", "/**\n * The ...
Displays a popup list of hints for a given editor context. @constructor @param {Editor} editor @param {boolean} insertHintOnTab Whether pressing tab inserts the selected hint @param {number} maxResults Maximum hints displayed at once. Defaults to 50
[ "Displays", "a", "popup", "list", "of", "hints", "for", "a", "given", "editor", "context", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/CodeHintList.js#L47-L124
train
A CodeHintList is a base class for the list of hints.
[ 30522, 3853, 30524, 4226, 2854, 16429, 20614, 1028, 1065, 1008, 1013, 2023, 1012, 20385, 1027, 1031, 1033, 1025, 1013, 1008, 1008, 1008, 1996, 3479, 2597, 1999, 1996, 2862, 1025, 4728, 1011, 1015, 1012, 1008, 1008, 1030, 2828, 1063, 2193, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/_AnnotationHelperExpression.js
function (oInterface, oPathValue) { var oParameter; oPathValue.asExpression = true; oParameter = Expression.expression(oInterface, oPathValue); return { result : "expression", value : "!" + Basics.resultToString(Expression.wrapExpression(oParameter), true), type : "Edm.Boolean" }; }
javascript
function (oInterface, oPathValue) { var oParameter; oPathValue.asExpression = true; oParameter = Expression.expression(oInterface, oPathValue); return { result : "expression", value : "!" + Basics.resultToString(Expression.wrapExpression(oParameter), true), type : "Edm.Boolean" }; }
[ "function", "(", "oInterface", ",", "oPathValue", ")", "{", "var", "oParameter", ";", "oPathValue", ".", "asExpression", "=", "true", ";", "oParameter", "=", "Expression", ".", "expression", "(", "oInterface", ",", "oPathValue", ")", ";", "return", "{", "res...
Handling of "14.5.1 Comparison and Logical Operators": <code>edm:Not</code>. @param {sap.ui.core.util.XMLPreprocessor.IContext|sap.ui.model.Context} oInterface the callback interface related to the current formatter call @param {object} oPathValue path and value information pointing to the parameter (see Expression object) @returns {object} the result object
[ "Handling", "of", "14", ".", "5", ".", "1", "Comparison", "and", "Logical", "Operators", ":", "<code", ">", "edm", ":", "Not<", "/", "code", ">", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperExpression.js#L547-L557
train
Returns an object with the type of the parameter
[ 30522, 3853, 1006, 1051, 18447, 2121, 12172, 1010, 6728, 8988, 10175, 5657, 1007, 1063, 13075, 6728, 5400, 22828, 1025, 6728, 8988, 10175, 5657, 1012, 2004, 10288, 20110, 3258, 1027, 2995, 1025, 6728, 5400, 22828, 1027, 3670, 1012, 3670, 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...
nhn/tui.editor
src/js/extensions/table/tableRangeHandler.js
_expandMergedRange
function _expandMergedRange(tableData, tableRange) { let rangeStr = ''; while (rangeStr !== JSON.stringify(tableRange)) { rangeStr = JSON.stringify(tableRange); _expandRowMergedRange(tableData, tableRange, 'start'); _expandRowMergedRange(tableData, tableRange, 'end'); util.range(tableRange.start.rowIndex, tableRange.end.rowIndex + 1).forEach(rowIndex => { _expandColMergedRange(tableData, tableRange, rowIndex, tableRange.start.colIndex); _expandColMergedRange(tableData, tableRange, rowIndex, tableRange.end.colIndex); }); } return tableRange; }
javascript
function _expandMergedRange(tableData, tableRange) { let rangeStr = ''; while (rangeStr !== JSON.stringify(tableRange)) { rangeStr = JSON.stringify(tableRange); _expandRowMergedRange(tableData, tableRange, 'start'); _expandRowMergedRange(tableData, tableRange, 'end'); util.range(tableRange.start.rowIndex, tableRange.end.rowIndex + 1).forEach(rowIndex => { _expandColMergedRange(tableData, tableRange, rowIndex, tableRange.start.colIndex); _expandColMergedRange(tableData, tableRange, rowIndex, tableRange.end.colIndex); }); } return tableRange; }
[ "function", "_expandMergedRange", "(", "tableData", ",", "tableRange", ")", "{", "let", "rangeStr", "=", "''", ";", "while", "(", "rangeStr", "!==", "JSON", ".", "stringify", "(", "tableRange", ")", ")", "{", "rangeStr", "=", "JSON", ".", "stringify", "(",...
Expand table range by merge properties like colspan, rowspan. @param {Array.<Array.<object>>} tableData - table data @param {{ start: {rowIndex: number, colIndex: number}, end: {rowIndex: number, colIndex: number} }} tableRange - table range @returns {{ start: {rowIndex: number, colIndex: number}, end: {rowIndex: number, colIndex: number} }} @private
[ "Expand", "table", "range", "by", "merge", "properties", "like", "colspan", "rowspan", "." ]
e75ab08c2a7ab07d1143e318f7cde135c5e3002e
https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/table/tableRangeHandler.js#L135-L151
train
Expand the table range into a table range that is merged with the previous table range
[ 30522, 3853, 1035, 7818, 5017, 5999, 24388, 2063, 1006, 2795, 2850, 2696, 1010, 2795, 24388, 2063, 1007, 1063, 2292, 8483, 16344, 1027, 1005, 1005, 1025, 2096, 1006, 8483, 16344, 999, 1027, 1027, 1046, 3385, 1012, 5164, 8757, 1006, 2795, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
swimlane/ngx-datatable
release/utils/column.js
columnsByPin
function columnsByPin(cols) { var ret = { left: [], center: [], right: [] }; if (cols) { for (var _i = 0, cols_1 = cols; _i < cols_1.length; _i++) { var col = cols_1[_i]; if (col.frozenLeft) { ret.left.push(col); } else if (col.frozenRight) { ret.right.push(col); } else { ret.center.push(col); } } } return ret; }
javascript
function columnsByPin(cols) { var ret = { left: [], center: [], right: [] }; if (cols) { for (var _i = 0, cols_1 = cols; _i < cols_1.length; _i++) { var col = cols_1[_i]; if (col.frozenLeft) { ret.left.push(col); } else if (col.frozenRight) { ret.right.push(col); } else { ret.center.push(col); } } } return ret; }
[ "function", "columnsByPin", "(", "cols", ")", "{", "var", "ret", "=", "{", "left", ":", "[", "]", ",", "center", ":", "[", "]", ",", "right", ":", "[", "]", "}", ";", "if", "(", "cols", ")", "{", "for", "(", "var", "_i", "=", "0", ",", "col...
Returns the columns by pin.
[ "Returns", "the", "columns", "by", "pin", "." ]
d7df15a070282a169524dba51d9572008b74804c
https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/column.js#L6-L27
train
returns a list of columns by pin
[ 30522, 3853, 7753, 3762, 8091, 1006, 8902, 2015, 1007, 1063, 13075, 2128, 2102, 1027, 1063, 2187, 1024, 1031, 1033, 1010, 2415, 1024, 1031, 1033, 1010, 2157, 1024, 1031, 1033, 1065, 1025, 2065, 1006, 8902, 2015, 1007, 1063, 2005, 1006, 13...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jgraph/mxgraph
javascript/mxClient.js
function(node, includeAncestors, includeDocument) { includeAncestors = (includeAncestors != null) ? includeAncestors : false; includeDocument = (includeDocument != null) ? includeDocument : true; var doc = (node != null) ? node.ownerDocument : document; var b = doc.body; var d = doc.documentElement; var result = new mxPoint(); var fixed = false; while (node != null && node != b && node != d) { if (!isNaN(node.scrollLeft) && !isNaN(node.scrollTop)) { result.x += node.scrollLeft; result.y += node.scrollTop; } var style = mxUtils.getCurrentStyle(node); if (style != null) { fixed = fixed || style.position == 'fixed'; } node = (includeAncestors) ? node.parentNode : null; } if (!fixed && includeDocument) { var origin = mxUtils.getDocumentScrollOrigin(doc); result.x += origin.x; result.y += origin.y; } return result; }
javascript
function(node, includeAncestors, includeDocument) { includeAncestors = (includeAncestors != null) ? includeAncestors : false; includeDocument = (includeDocument != null) ? includeDocument : true; var doc = (node != null) ? node.ownerDocument : document; var b = doc.body; var d = doc.documentElement; var result = new mxPoint(); var fixed = false; while (node != null && node != b && node != d) { if (!isNaN(node.scrollLeft) && !isNaN(node.scrollTop)) { result.x += node.scrollLeft; result.y += node.scrollTop; } var style = mxUtils.getCurrentStyle(node); if (style != null) { fixed = fixed || style.position == 'fixed'; } node = (includeAncestors) ? node.parentNode : null; } if (!fixed && includeDocument) { var origin = mxUtils.getDocumentScrollOrigin(doc); result.x += origin.x; result.y += origin.y; } return result; }
[ "function", "(", "node", ",", "includeAncestors", ",", "includeDocument", ")", "{", "includeAncestors", "=", "(", "includeAncestors", "!=", "null", ")", "?", "includeAncestors", ":", "false", ";", "includeDocument", "=", "(", "includeDocument", "!=", "null", ")"...
Function: getScrollOrigin Returns the top, left corner of the viewrect as an <mxPoint>. Parameters: node - DOM node whose scroll origin should be returned. includeAncestors - Whether the scroll origin of the ancestors should be included. Default is false. includeDocument - Whether the scroll origin of the document should be included. Default is true.
[ "Function", ":", "getScrollOrigin" ]
33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44
https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L4831-L4869
train
Returns the position of the node in the document.
[ 30522, 3853, 1006, 13045, 1010, 2421, 26755, 6591, 1010, 2443, 10085, 27417, 2102, 1007, 1063, 2421, 26755, 6591, 1027, 1006, 2421, 26755, 6591, 999, 1027, 19701, 1007, 1029, 2421, 26755, 6591, 1024, 6270, 1025, 2443, 10085, 27417, 2102, 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
tools/internal-rules/no-invalid-meta.js
checkMetaValidity
function checkMetaValidity(context, exportsNode) { const metaProperty = getMetaPropertyFromExportsNode(exportsNode); if (!metaProperty) { context.report({ node: exportsNode, messageId: "missingMeta" }); return; } if (!hasMetaDocs(metaProperty)) { context.report({ node: metaProperty, messageId: "missingMetaDocs" }); return; } if (!hasMetaDocsDescription(metaProperty)) { context.report({ node: metaProperty, messageId: "missingMetaDocsDescription" }); return; } if (!hasMetaDocsCategory(metaProperty)) { context.report({ node: metaProperty, messageId: "missingMetaDocsCategory" }); return; } if (!hasMetaDocsRecommended(metaProperty)) { context.report({ node: metaProperty, messageId: "missingMetaDocsRecommended" }); return; } if (!hasMetaSchema(metaProperty)) { context.report({ node: metaProperty, messageId: "missingMetaSchema" }); } }
javascript
function checkMetaValidity(context, exportsNode) { const metaProperty = getMetaPropertyFromExportsNode(exportsNode); if (!metaProperty) { context.report({ node: exportsNode, messageId: "missingMeta" }); return; } if (!hasMetaDocs(metaProperty)) { context.report({ node: metaProperty, messageId: "missingMetaDocs" }); return; } if (!hasMetaDocsDescription(metaProperty)) { context.report({ node: metaProperty, messageId: "missingMetaDocsDescription" }); return; } if (!hasMetaDocsCategory(metaProperty)) { context.report({ node: metaProperty, messageId: "missingMetaDocsCategory" }); return; } if (!hasMetaDocsRecommended(metaProperty)) { context.report({ node: metaProperty, messageId: "missingMetaDocsRecommended" }); return; } if (!hasMetaSchema(metaProperty)) { context.report({ node: metaProperty, messageId: "missingMetaSchema" }); } }
[ "function", "checkMetaValidity", "(", "context", ",", "exportsNode", ")", "{", "const", "metaProperty", "=", "getMetaPropertyFromExportsNode", "(", "exportsNode", ")", ";", "if", "(", "!", "metaProperty", ")", "{", "context", ".", "report", "(", "{", "node", "...
Checks the validity of the meta definition of this rule and reports any errors found. @param {RuleContext} context The ESLint rule context. @param {ASTNode} exportsNode ObjectExpression node that the rule exports. @param {boolean} ruleIsFixable whether the rule is fixable or not. @returns {void}
[ "Checks", "the", "validity", "of", "the", "meta", "definition", "of", "this", "rule", "and", "reports", "any", "errors", "found", "." ]
bc0819c94aad14f7fad3cbc2338ea15658b0f272
https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/tools/internal-rules/no-invalid-meta.js#L110-L141
train
Checks if the meta property is valid
[ 30522, 3853, 4638, 11368, 12462, 21273, 3012, 1006, 6123, 1010, 14338, 3630, 3207, 1007, 1063, 9530, 3367, 18804, 21572, 4842, 3723, 1027, 2131, 11368, 9331, 18981, 15010, 19699, 8462, 2595, 25378, 3630, 3207, 1006, 14338, 3630, 3207, 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...
thomaspark/bootswatch
docs/3/bower_components/html5shiv/dist/html5shiv-printshiv.js
createElement
function createElement(nodeName, ownerDocument, data){ if (!ownerDocument) { ownerDocument = document; } if(supportsUnknownElements){ return ownerDocument.createElement(nodeName); } if (!data) { data = getExpandoData(ownerDocument); } var node; if (data.cache[nodeName]) { node = data.cache[nodeName].cloneNode(); } else if (saveClones.test(nodeName)) { node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode(); } else { node = data.createElem(nodeName); } // Avoid adding some elements to fragments in IE < 9 because // * Attributes like `name` or `type` cannot be set/changed once an element // is inserted into a document/fragment // * Link elements with `src` attributes that are inaccessible, as with // a 403 response, will cause the tab/window to crash // * Script elements appended to fragments will execute when their `src` // or `text` property is set return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node; }
javascript
function createElement(nodeName, ownerDocument, data){ if (!ownerDocument) { ownerDocument = document; } if(supportsUnknownElements){ return ownerDocument.createElement(nodeName); } if (!data) { data = getExpandoData(ownerDocument); } var node; if (data.cache[nodeName]) { node = data.cache[nodeName].cloneNode(); } else if (saveClones.test(nodeName)) { node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode(); } else { node = data.createElem(nodeName); } // Avoid adding some elements to fragments in IE < 9 because // * Attributes like `name` or `type` cannot be set/changed once an element // is inserted into a document/fragment // * Link elements with `src` attributes that are inaccessible, as with // a 403 response, will cause the tab/window to crash // * Script elements appended to fragments will execute when their `src` // or `text` property is set return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node; }
[ "function", "createElement", "(", "nodeName", ",", "ownerDocument", ",", "data", ")", "{", "if", "(", "!", "ownerDocument", ")", "{", "ownerDocument", "=", "document", ";", "}", "if", "(", "supportsUnknownElements", ")", "{", "return", "ownerDocument", ".", ...
returns a shived element for the given nodeName and document @memberOf html5 @param {String} nodeName name of the element @param {Document} ownerDocument The context document. @returns {Object} The shived element.
[ "returns", "a", "shived", "element", "for", "the", "given", "nodeName", "and", "document" ]
a913e4992dad8f7bf38df2e1d3f4cc6bfe5f26dd
https://github.com/thomaspark/bootswatch/blob/a913e4992dad8f7bf38df2e1d3f4cc6bfe5f26dd/docs/3/bower_components/html5shiv/dist/html5shiv-printshiv.js#L127-L155
train
Creates a new element
[ 30522, 3853, 3443, 12260, 3672, 1006, 13045, 18442, 1010, 3954, 3527, 24894, 4765, 1010, 2951, 1007, 1063, 2065, 1006, 999, 3954, 3527, 24894, 4765, 1007, 1063, 3954, 3527, 24894, 4765, 1027, 6254, 1025, 1065, 2065, 1006, 6753, 16814, 19779...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/RoadMapStep.js
function(oThis, sName, oValue, fDomAdaptationCallback){ if (!oThis.getDomRef()) { oThis.setProperty(sName, oValue); return; } var bSkipUpdate = fDomAdaptationCallback.apply(oThis, []); if (!bSkipUpdate) { oThis.setProperty(sName, oValue, true); } }
javascript
function(oThis, sName, oValue, fDomAdaptationCallback){ if (!oThis.getDomRef()) { oThis.setProperty(sName, oValue); return; } var bSkipUpdate = fDomAdaptationCallback.apply(oThis, []); if (!bSkipUpdate) { oThis.setProperty(sName, oValue, true); } }
[ "function", "(", "oThis", ",", "sName", ",", "oValue", ",", "fDomAdaptationCallback", ")", "{", "if", "(", "!", "oThis", ".", "getDomRef", "(", ")", ")", "{", "oThis", ".", "setProperty", "(", "sName", ",", "oValue", ")", ";", "return", ";", "}", "va...
Helper function to set a property without rerendering (see overridden setter functions)
[ "Helper", "function", "to", "set", "a", "property", "without", "rerendering", "(", "see", "overridden", "setter", "functions", ")" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/RoadMapStep.js#L245-L254
train
Sets the property of the given control.
[ 30522, 3853, 1006, 27178, 24158, 1010, 1055, 18442, 1010, 9242, 5657, 1010, 1042, 9527, 8447, 22799, 3508, 9289, 20850, 8684, 1007, 1063, 2065, 1006, 999, 27178, 24158, 1012, 2131, 9527, 2890, 2546, 1006, 1007, 1007, 1063, 27178, 24158, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SeleniumHQ/selenium
javascript/selenium-core/lib/prototype.js
function(mode, element) { if (!mode) return 0; if (mode == 'vertical') return ((this.offset[1] + element.offsetHeight) - this.ycomp) / element.offsetHeight; if (mode == 'horizontal') return ((this.offset[0] + element.offsetWidth) - this.xcomp) / element.offsetWidth; }
javascript
function(mode, element) { if (!mode) return 0; if (mode == 'vertical') return ((this.offset[1] + element.offsetHeight) - this.ycomp) / element.offsetHeight; if (mode == 'horizontal') return ((this.offset[0] + element.offsetWidth) - this.xcomp) / element.offsetWidth; }
[ "function", "(", "mode", ",", "element", ")", "{", "if", "(", "!", "mode", ")", "return", "0", ";", "if", "(", "mode", "==", "'vertical'", ")", "return", "(", "(", "this", ".", "offset", "[", "1", "]", "+", "element", ".", "offsetHeight", ")", "-...
within must be called directly before
[ "within", "must", "be", "called", "directly", "before" ]
38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd
https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/lib/prototype.js#L1868-L1876
train
Returns the distance in the specified element
[ 30522, 3853, 1006, 5549, 1010, 5783, 1007, 1063, 2065, 1006, 999, 5549, 1007, 2709, 1014, 1025, 2065, 1006, 5549, 1027, 1027, 1005, 7471, 1005, 1007, 2709, 1006, 1006, 2023, 1012, 16396, 1031, 1015, 1033, 1009, 5783, 1012, 16396, 26036, 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...
GeekyAnts/vue-native-core
packages/vue-server-renderer/build.js
RenderContext
function RenderContext (options) { this.userContext = options.userContext; this.activeInstance = options.activeInstance; this.renderStates = []; this.write = options.write; this.done = options.done; this.renderNode = options.renderNode; this.isUnaryTag = options.isUnaryTag; this.modules = options.modules; this.directives = options.directives; var cache = options.cache; if (cache && (!cache.get || !cache.set)) { throw new Error('renderer cache must implement at least get & set.') } this.cache = cache; this.get = cache && normalizeAsync(cache, 'get'); this.has = cache && normalizeAsync(cache, 'has'); this.next = this.next.bind(this); }
javascript
function RenderContext (options) { this.userContext = options.userContext; this.activeInstance = options.activeInstance; this.renderStates = []; this.write = options.write; this.done = options.done; this.renderNode = options.renderNode; this.isUnaryTag = options.isUnaryTag; this.modules = options.modules; this.directives = options.directives; var cache = options.cache; if (cache && (!cache.get || !cache.set)) { throw new Error('renderer cache must implement at least get & set.') } this.cache = cache; this.get = cache && normalizeAsync(cache, 'get'); this.has = cache && normalizeAsync(cache, 'has'); this.next = this.next.bind(this); }
[ "function", "RenderContext", "(", "options", ")", "{", "this", ".", "userContext", "=", "options", ".", "userContext", ";", "this", ".", "activeInstance", "=", "options", ".", "activeInstance", ";", "this", ".", "renderStates", "=", "[", "]", ";", "this", ...
/*
[ "/", "*" ]
a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e
https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/packages/vue-server-renderer/build.js#L2109-L2131
train
The RenderContext class
[ 30522, 3853, 17552, 8663, 18209, 1006, 7047, 1007, 1063, 2023, 1012, 5310, 8663, 18209, 1027, 7047, 1012, 5310, 8663, 18209, 1025, 2023, 1012, 3161, 7076, 26897, 1027, 7047, 1012, 3161, 7076, 26897, 1025, 2023, 1012, 17552, 9153, 4570, 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...
SAP/openui5
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
function(sServiceRootURI) { var sResourcePath = null; if (!this._bUseMasterData && this._oParameterizationRequest) { sResourcePath = this._oParameterizationRequest.getURIToParameterizationEntry(sServiceRootURI) + "/" + this._oDimension.getContainingQueryResult().getParameterization().getNavigationPropertyToQueryResult(); } else { sResourcePath = (sServiceRootURI ? sServiceRootURI : "") + "/" + this._oEntitySet.getQName(); } return sResourcePath; }
javascript
function(sServiceRootURI) { var sResourcePath = null; if (!this._bUseMasterData && this._oParameterizationRequest) { sResourcePath = this._oParameterizationRequest.getURIToParameterizationEntry(sServiceRootURI) + "/" + this._oDimension.getContainingQueryResult().getParameterization().getNavigationPropertyToQueryResult(); } else { sResourcePath = (sServiceRootURI ? sServiceRootURI : "") + "/" + this._oEntitySet.getQName(); } return sResourcePath; }
[ "function", "(", "sServiceRootURI", ")", "{", "var", "sResourcePath", "=", "null", ";", "if", "(", "!", "this", ".", "_bUseMasterData", "&&", "this", ".", "_oParameterizationRequest", ")", "{", "sResourcePath", "=", "this", ".", "_oParameterizationRequest", ".",...
Get the URI to locate the entity set for the dimension memebers. @param {String} sServiceRootURI (optional) Identifies the root of the OData service @returns {String} The resource path of the URI pointing to the entity set. It is a relative URI unless a service root is given, which would then prefixed in order to return a complete URL. @public @function @name sap.ui.model.analytics.odata4analytics.DimensionMemberSetRequest#getURIToDimensionMemberEntitySet
[ "Get", "the", "URI", "to", "locate", "the", "entity", "set", "for", "the", "dimension", "memebers", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L5536-L5545
train
Returns the resource path for the entity set
[ 30522, 3853, 1006, 7020, 2121, 7903, 10624, 4140, 9496, 1007, 1063, 13075, 5034, 2229, 8162, 3401, 15069, 1027, 19701, 1025, 2065, 1006, 999, 2023, 1012, 1035, 3902, 14545, 6238, 2850, 2696, 1004, 1004, 2023, 1012, 1035, 6728, 5400, 22828, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SeleniumHQ/selenium
third_party/js/mozmill/shared-modules/widgets.js
clickTreeCell
function clickTreeCell(controller, tree, rowIndex, columnIndex, eventDetails) { tree = tree.getNode(); var selection = tree.view.selection; selection.select(rowIndex); tree.treeBoxObject.ensureRowIsVisible(rowIndex); // get cell coordinates var x = {}, y = {}, width = {}, height = {}; var column = tree.columns[columnIndex]; tree.treeBoxObject.getCoordsForCellItem(rowIndex, column, "text", x, y, width, height); controller.sleep(0); EventUtils.synthesizeMouse(tree.body, x.value + 4, y.value + 4, eventDetails, tree.ownerDocument.defaultView); controller.sleep(0); }
javascript
function clickTreeCell(controller, tree, rowIndex, columnIndex, eventDetails) { tree = tree.getNode(); var selection = tree.view.selection; selection.select(rowIndex); tree.treeBoxObject.ensureRowIsVisible(rowIndex); // get cell coordinates var x = {}, y = {}, width = {}, height = {}; var column = tree.columns[columnIndex]; tree.treeBoxObject.getCoordsForCellItem(rowIndex, column, "text", x, y, width, height); controller.sleep(0); EventUtils.synthesizeMouse(tree.body, x.value + 4, y.value + 4, eventDetails, tree.ownerDocument.defaultView); controller.sleep(0); }
[ "function", "clickTreeCell", "(", "controller", ",", "tree", ",", "rowIndex", ",", "columnIndex", ",", "eventDetails", ")", "{", "tree", "=", "tree", ".", "getNode", "(", ")", ";", "var", "selection", "=", "tree", ".", "view", ".", "selection", ";", "sel...
Click the specified tree cell @param {MozMillController} controller MozMillController of the browser window to operate on @param {tree} tree Tree to operate on @param {number } rowIndex Index of the row @param {number} columnIndex Index of the column @param {object} eventDetails Details about the mouse event
[ "Click", "the", "specified", "tree", "cell" ]
38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd
https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/widgets.js#L61-L79
train
clicks a cell in a tree
[ 30522, 3853, 11562, 13334, 29109, 2140, 1006, 11486, 1010, 3392, 1010, 5216, 22254, 10288, 1010, 5930, 22254, 10288, 1010, 2724, 3207, 22081, 1007, 1063, 3392, 1027, 3392, 1012, 2131, 3630, 3207, 1006, 1007, 1025, 13075, 4989, 1027, 3392, 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...
TryGhost/Ghost
core/server/models/post.js
add
function add(data, unfilteredOptions) { let options = this.filterOptions(unfilteredOptions, 'add', {extraAllowedProperties: ['id']}); const addPost = (() => { return ghostBookshelf.Model.add.call(this, data, options) .then((post) => { return this.findOne({ status: 'all', id: post.id }, _.merge({transacting: options.transacting}, unfilteredOptions)); }); }); if (!options.transacting) { return ghostBookshelf.transaction((transacting) => { options.transacting = transacting; return addPost(); }); } return addPost(); }
javascript
function add(data, unfilteredOptions) { let options = this.filterOptions(unfilteredOptions, 'add', {extraAllowedProperties: ['id']}); const addPost = (() => { return ghostBookshelf.Model.add.call(this, data, options) .then((post) => { return this.findOne({ status: 'all', id: post.id }, _.merge({transacting: options.transacting}, unfilteredOptions)); }); }); if (!options.transacting) { return ghostBookshelf.transaction((transacting) => { options.transacting = transacting; return addPost(); }); } return addPost(); }
[ "function", "add", "(", "data", ",", "unfilteredOptions", ")", "{", "let", "options", "=", "this", ".", "filterOptions", "(", "unfilteredOptions", ",", "'add'", ",", "{", "extraAllowedProperties", ":", "[", "'id'", "]", "}", ")", ";", "const", "addPost", "...
### Add @extends ghostBookshelf.Model.add to handle returning the full object **See:** [ghostBookshelf.Model.add](base.js.html#add)
[ "###", "Add" ]
bb7bb55cf3e60af99ebbc56099928827b58461bc
https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/models/post.js#L820-L842
train
Add a new post
[ 30522, 3853, 5587, 1006, 2951, 1010, 4895, 8873, 21928, 26010, 16790, 2015, 1007, 1063, 2292, 7047, 1027, 2023, 1012, 11307, 7361, 9285, 1006, 4895, 8873, 21928, 26010, 16790, 2015, 1010, 1005, 5587, 1005, 1010, 1063, 4469, 8095, 15096, 215...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
showdownjs/showdown
dist/showdown.js
substitutePreCodeTags
function substitutePreCodeTags (doc) { var pres = doc.querySelectorAll('pre'), presPH = []; for (var i = 0; i < pres.length; ++i) { if (pres[i].childElementCount === 1 && pres[i].firstChild.tagName.toLowerCase() === 'code') { var content = pres[i].firstChild.innerHTML.trim(), language = pres[i].firstChild.getAttribute('data-language') || ''; // if data-language attribute is not defined, then we look for class language-* if (language === '') { var classes = pres[i].firstChild.className.split(' '); for (var c = 0; c < classes.length; ++c) { var matches = classes[c].match(/^language-(.+)$/); if (matches !== null) { language = matches[1]; break; } } } // unescape html entities in content content = showdown.helper.unescapeHTMLEntities(content); presPH.push(content); pres[i].outerHTML = '<precode language="' + language + '" precodenum="' + i.toString() + '"></precode>'; } else { presPH.push(pres[i].innerHTML); pres[i].innerHTML = ''; pres[i].setAttribute('prenum', i.toString()); } } return presPH; }
javascript
function substitutePreCodeTags (doc) { var pres = doc.querySelectorAll('pre'), presPH = []; for (var i = 0; i < pres.length; ++i) { if (pres[i].childElementCount === 1 && pres[i].firstChild.tagName.toLowerCase() === 'code') { var content = pres[i].firstChild.innerHTML.trim(), language = pres[i].firstChild.getAttribute('data-language') || ''; // if data-language attribute is not defined, then we look for class language-* if (language === '') { var classes = pres[i].firstChild.className.split(' '); for (var c = 0; c < classes.length; ++c) { var matches = classes[c].match(/^language-(.+)$/); if (matches !== null) { language = matches[1]; break; } } } // unescape html entities in content content = showdown.helper.unescapeHTMLEntities(content); presPH.push(content); pres[i].outerHTML = '<precode language="' + language + '" precodenum="' + i.toString() + '"></precode>'; } else { presPH.push(pres[i].innerHTML); pres[i].innerHTML = ''; pres[i].setAttribute('prenum', i.toString()); } } return presPH; }
[ "function", "substitutePreCodeTags", "(", "doc", ")", "{", "var", "pres", "=", "doc", ".", "querySelectorAll", "(", "'pre'", ")", ",", "presPH", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "pres", ".", "length", ";", "++", ...
find all pre tags and replace contents with placeholder we need this so that we can remove all indentation from html to ease up parsing
[ "find", "all", "pre", "tags", "and", "replace", "contents", "with", "placeholder", "we", "need", "this", "so", "that", "we", "can", "remove", "all", "indentation", "from", "html", "to", "ease", "up", "parsing" ]
33bba54535d6fcdde5c82d2ec4d7a3bd951b5bb9
https://github.com/showdownjs/showdown/blob/33bba54535d6fcdde5c82d2ec4d7a3bd951b5bb9/dist/showdown.js#L5249-L5284
train
substitute pre code tags
[ 30522, 3853, 7681, 28139, 16044, 15900, 2015, 1006, 9986, 1007, 1063, 13075, 3653, 2015, 1027, 9986, 1012, 23032, 11246, 22471, 6525, 3363, 1006, 1005, 3653, 1005, 1007, 1010, 3653, 13102, 2232, 1027, 1031, 1033, 1025, 2005, 1006, 13075, 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...
fengyuanchen/cropper
dist/cropper.common.js
forEach
function forEach(data, callback) { if (data && isFunction(callback)) { if (Array.isArray(data) || isNumber(data.length) /* array-like */) { var length = data.length; var i = void 0; for (i = 0; i < length; i += 1) { if (callback.call(data, data[i], i, data) === false) { break; } } } else if (isObject(data)) { Object.keys(data).forEach(function (key) { callback.call(data, data[key], key, data); }); } } return data; }
javascript
function forEach(data, callback) { if (data && isFunction(callback)) { if (Array.isArray(data) || isNumber(data.length) /* array-like */) { var length = data.length; var i = void 0; for (i = 0; i < length; i += 1) { if (callback.call(data, data[i], i, data) === false) { break; } } } else if (isObject(data)) { Object.keys(data).forEach(function (key) { callback.call(data, data[key], key, data); }); } } return data; }
[ "function", "forEach", "(", "data", ",", "callback", ")", "{", "if", "(", "data", "&&", "isFunction", "(", "callback", ")", ")", "{", "if", "(", "Array", ".", "isArray", "(", "data", ")", "||", "isNumber", "(", "data", ".", "length", ")", "/* array-l...
Iterate the given data. @param {*} data - The data to iterate. @param {Function} callback - The process function for each element. @returns {*} The original data.
[ "Iterate", "the", "given", "data", "." ]
6677332a6a375b647f58808dfc24ea09f5804041
https://github.com/fengyuanchen/cropper/blob/6677332a6a375b647f58808dfc24ea09f5804041/dist/cropper.common.js#L283-L303
train
Iterate over the data object
[ 30522, 3853, 18921, 6776, 1006, 2951, 1010, 2655, 5963, 1007, 1063, 2065, 1006, 2951, 1004, 1004, 2003, 11263, 27989, 1006, 2655, 5963, 1007, 1007, 1063, 2065, 1006, 9140, 1012, 18061, 11335, 2100, 1006, 2951, 1007, 1064, 1064, 3475, 29440,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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-this-before-super.js
isConstructorFunction
function isConstructorFunction(node) { return ( node.type === "FunctionExpression" && node.parent.type === "MethodDefinition" && node.parent.kind === "constructor" ); }
javascript
function isConstructorFunction(node) { return ( node.type === "FunctionExpression" && node.parent.type === "MethodDefinition" && node.parent.kind === "constructor" ); }
[ "function", "isConstructorFunction", "(", "node", ")", "{", "return", "(", "node", ".", "type", "===", "\"FunctionExpression\"", "&&", "node", ".", "parent", ".", "type", "===", "\"MethodDefinition\"", "&&", "node", ".", "parent", ".", "kind", "===", "\"constr...
------------------------------------------------------------------------------ Helpers ------------------------------------------------------------------------------ Checks whether or not a given node is a constructor. @param {ASTNode} node - A node to check. This node type is one of `Program`, `FunctionDeclaration`, `FunctionExpression`, and `ArrowFunctionExpression`. @returns {boolean} `true` if the node is a constructor.
[ "------------------------------------------------------------------------------", "Helpers", "------------------------------------------------------------------------------", "Checks", "whether", "or", "not", "a", "given", "node", "is", "a", "constructor", "." ]
bc0819c94aad14f7fad3cbc2338ea15658b0f272
https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-this-before-super.js#L25-L31
train
Returns true if the node is a constructor function
[ 30522, 3853, 2003, 8663, 3367, 6820, 16761, 11263, 27989, 1006, 13045, 1007, 1063, 2709, 1006, 13045, 1012, 2828, 1027, 1027, 1027, 1000, 3853, 10288, 20110, 3258, 1000, 1004, 1004, 13045, 1012, 6687, 1012, 2828, 1027, 1027, 1027, 1000, 411...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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
mxArrow
function mxArrow(points, fill, stroke, strokewidth, arrowWidth, spacing, endSize) { mxShape.call(this); this.points = points; this.fill = fill; this.stroke = stroke; this.strokewidth = (strokewidth != null) ? strokewidth : 1; this.arrowWidth = (arrowWidth != null) ? arrowWidth : mxConstants.ARROW_WIDTH; this.spacing = (spacing != null) ? spacing : mxConstants.ARROW_SPACING; this.endSize = (endSize != null) ? endSize : mxConstants.ARROW_SIZE; }
javascript
function mxArrow(points, fill, stroke, strokewidth, arrowWidth, spacing, endSize) { mxShape.call(this); this.points = points; this.fill = fill; this.stroke = stroke; this.strokewidth = (strokewidth != null) ? strokewidth : 1; this.arrowWidth = (arrowWidth != null) ? arrowWidth : mxConstants.ARROW_WIDTH; this.spacing = (spacing != null) ? spacing : mxConstants.ARROW_SPACING; this.endSize = (endSize != null) ? endSize : mxConstants.ARROW_SIZE; }
[ "function", "mxArrow", "(", "points", ",", "fill", ",", "stroke", ",", "strokewidth", ",", "arrowWidth", ",", "spacing", ",", "endSize", ")", "{", "mxShape", ".", "call", "(", "this", ")", ";", "this", ".", "points", "=", "points", ";", "this", ".", ...
Copyright (c) 2006-2015, JGraph Ltd Copyright (c) 2006-2015, Gaudenz Alder Class: mxArrow Extends <mxShape> to implement an arrow shape. (The shape is used to represent edges, not vertices.) This shape is registered under <mxConstants.SHAPE_ARROW> in <mxCellRenderer>. Constructor: mxArrow Constructs a new arrow shape. Parameters: points - Array of <mxPoints> that define the points. This is stored in <mxShape.points>. fill - String that defines the fill color. This is stored in <fill>. stroke - String that defines the stroke color. This is stored in <stroke>. strokewidth - Optional integer that defines the stroke width. Default is 1. This is stored in <strokewidth>. arrowWidth - Optional integer that defines the arrow width. Default is <mxConstants.ARROW_WIDTH>. This is stored in <arrowWidth>. spacing - Optional integer that defines the spacing between the arrow shape and its endpoints. Default is <mxConstants.ARROW_SPACING>. This is stored in <spacing>. endSize - Optional integer that defines the size of the arrowhead. Default is <mxConstants.ARROW_SIZE>. This is stored in <endSize>.
[ "Copyright", "(", "c", ")", "2006", "-", "2015", "JGraph", "Ltd", "Copyright", "(", "c", ")", "2006", "-", "2015", "Gaudenz", "Alder", "Class", ":", "mxArrow" ]
33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44
https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L25470-L25480
train
A wrapper around mxShape to create an arrow
[ 30522, 3853, 25630, 2906, 10524, 1006, 2685, 1010, 6039, 1010, 6909, 1010, 6909, 9148, 11927, 2232, 1010, 8612, 9148, 11927, 2232, 1010, 12403, 6129, 1010, 4515, 4697, 1007, 1063, 25630, 7377, 5051, 1012, 2655, 1006, 2023, 1007, 1025, 2023,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js
visitAttributes
function visitAttributes(oElement, oWithControl) { /* * Comparator for DOM attributes by name. * * @param {Attr} oAttributeA * @param {Attr} oAttributeB * @returns {number} <0, 0, >0 */ function comparator(oAttributeA, oAttributeB) { return oAttributeA.name.localeCompare(oAttributeB.name); } return stopAndGo( // Note: iterate over a shallow copy to account for removal of attributes! // Note: sort attributes by name to achieve a stable log order across browsers Array.prototype.slice.apply(oElement.attributes).sort(comparator), function (oAttribute) { return visitAttribute(oElement, oAttribute, oWithControl); }); }
javascript
function visitAttributes(oElement, oWithControl) { /* * Comparator for DOM attributes by name. * * @param {Attr} oAttributeA * @param {Attr} oAttributeB * @returns {number} <0, 0, >0 */ function comparator(oAttributeA, oAttributeB) { return oAttributeA.name.localeCompare(oAttributeB.name); } return stopAndGo( // Note: iterate over a shallow copy to account for removal of attributes! // Note: sort attributes by name to achieve a stable log order across browsers Array.prototype.slice.apply(oElement.attributes).sort(comparator), function (oAttribute) { return visitAttribute(oElement, oAttribute, oWithControl); }); }
[ "function", "visitAttributes", "(", "oElement", ",", "oWithControl", ")", "{", "/*\n\t\t\t\t * Comparator for DOM attributes by name.\n\t\t\t\t *\n\t\t\t\t * @param {Attr} oAttributeA\n\t\t\t\t * @param {Attr} oAttributeB\n\t\t\t\t * @returns {number} <0, 0, >0\n\t\t\t\t */", "function", "compar...
Visits all attributes of the given element. If an attribute value represents a binding expression that can be resolved, it is replaced with the resulting value. @param {Element} oElement the XML DOM element @param {sap.ui.core.template._with} oWithControl the "with" control @returns {sap.ui.base.SyncPromise} A sync promise which resolves with <code>undefined</code> as soon as all attributes' values have been replaced, or is rejected with a corresponding error if getting some binding's value fails.
[ "Visits", "all", "attributes", "of", "the", "given", "element", ".", "If", "an", "attribute", "value", "represents", "a", "binding", "expression", "that", "can", "be", "resolved", "it", "is", "replaced", "with", "the", "resulting", "value", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js#L1749-L1768
train
Visit all attributes of an element
[ 30522, 3853, 3942, 19321, 3089, 8569, 4570, 1006, 1051, 12260, 3672, 1010, 27593, 8939, 8663, 13181, 2140, 1007, 1063, 1013, 1008, 1008, 4012, 28689, 4263, 2005, 14383, 12332, 2011, 2171, 1012, 1008, 1008, 1030, 11498, 2213, 1063, 2012, 163...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/JSUtils/node/TernNodeDomain.js
getScopeData
function getScopeData(fileInfo, offset) { // Create a new tern Server // Existing tern server resolves all the required modules which might take time // We only need to analyze single file for getting the scope ternOptions.plugins = {}; var ternServer = new Tern.Server(ternOptions); ternServer.addFile(fileInfo.name, fileInfo.text); var error; var request = buildRequest(fileInfo, "completions", offset); // for primepump try { // primepump ternServer.request(request, function (ternError, data) { if (ternError) { _log("Error for Tern request: \n" + JSON.stringify(request) + "\n" + ternError); error = ternError.toString(); } else { var file = ternServer.findFile(fileInfo.name); var scope = Infer.scopeAt(file.ast, Tern.resolvePos(file, offset), file.scope); if (scope) { // Remove unwanted properties to remove cycles in the object scope = JSON.parse(JSON.stringify(scope, function(key, value) { if (["proto", "propertyOf", "onNewProp", "sourceFile", "maybeProps"].includes(key)) { return undefined; } else if (key === "fnType") { return value.name || "FunctionExpression"; } else if (key === "props") { for (var key in value) { value[key] = value[key].propertyName; } return value; } else if (key === "originNode") { return value && { start: value.start, end: value.end, type: value.type, body: { start: value.body.start, end: value.body.end } }; } return value; })); } self.postMessage({ type: MessageIds.TERN_SCOPEDATA_MSG, file: _getNormalizedFilename(fileInfo.name), offset: offset, scope: scope }); } }); } catch (e) { _reportError(e, fileInfo.name); } finally { ternServer.reset(); Infer.resetGuessing(); } }
javascript
function getScopeData(fileInfo, offset) { // Create a new tern Server // Existing tern server resolves all the required modules which might take time // We only need to analyze single file for getting the scope ternOptions.plugins = {}; var ternServer = new Tern.Server(ternOptions); ternServer.addFile(fileInfo.name, fileInfo.text); var error; var request = buildRequest(fileInfo, "completions", offset); // for primepump try { // primepump ternServer.request(request, function (ternError, data) { if (ternError) { _log("Error for Tern request: \n" + JSON.stringify(request) + "\n" + ternError); error = ternError.toString(); } else { var file = ternServer.findFile(fileInfo.name); var scope = Infer.scopeAt(file.ast, Tern.resolvePos(file, offset), file.scope); if (scope) { // Remove unwanted properties to remove cycles in the object scope = JSON.parse(JSON.stringify(scope, function(key, value) { if (["proto", "propertyOf", "onNewProp", "sourceFile", "maybeProps"].includes(key)) { return undefined; } else if (key === "fnType") { return value.name || "FunctionExpression"; } else if (key === "props") { for (var key in value) { value[key] = value[key].propertyName; } return value; } else if (key === "originNode") { return value && { start: value.start, end: value.end, type: value.type, body: { start: value.body.start, end: value.body.end } }; } return value; })); } self.postMessage({ type: MessageIds.TERN_SCOPEDATA_MSG, file: _getNormalizedFilename(fileInfo.name), offset: offset, scope: scope }); } }); } catch (e) { _reportError(e, fileInfo.name); } finally { ternServer.reset(); Infer.resetGuessing(); } }
[ "function", "getScopeData", "(", "fileInfo", ",", "offset", ")", "{", "// Create a new tern Server", "// Existing tern server resolves all the required modules which might take time", "// We only need to analyze single file for getting the scope", "ternOptions", ".", "plugins", "=", "{...
Get scope at the offset in the file @param {{type: string, name: string, offsetLines: number, text: string}} fileInfo - type of update, name of file, and the text of the update. For "full" updates, the whole text of the file is present. For "part" updates, the changed portion of the text. For "empty" updates, the file has not been modified and the text is empty. @param {{line: number, ch: number}} offset - the offset into the file for cursor
[ "Get", "scope", "at", "the", "offset", "in", "the", "file" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/node/TernNodeDomain.js#L289-L354
train
Get scope data for a file
[ 30522, 3853, 4152, 16186, 2850, 2696, 1006, 5371, 2378, 14876, 1010, 16396, 1007, 1063, 1013, 1013, 3443, 1037, 2047, 28774, 2078, 8241, 1013, 1013, 4493, 28774, 2078, 8241, 10663, 2015, 2035, 1996, 3223, 14184, 2029, 2453, 2202, 2051, 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.imageViewer.js
function(target) { var self = this; if (target.tagName !== 'IMG') return false; return self.images.some(function(image) { return image == target; }); }
javascript
function(target) { var self = this; if (target.tagName !== 'IMG') return false; return self.images.some(function(image) { return image == target; }); }
[ "function", "(", "target", ")", "{", "var", "self", "=", "this", ";", "if", "(", "target", ".", "tagName", "!==", "'IMG'", ")", "return", "false", ";", "return", "self", ".", "images", ".", "some", "(", "function", "(", "image", ")", "{", "return", ...
检查图片是否为启动预览的图片
[ "检查图片是否为启动预览的图片" ]
ff74c90a1671a552f3604b1288bf38a4126312d0
https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/hello-mui/js/mui.imageViewer.js#L70-L76
train
Returns true if the specified target is an image
[ 30522, 3853, 1006, 4539, 1007, 1063, 13075, 2969, 1027, 2023, 1025, 2065, 1006, 4539, 1012, 6415, 18442, 999, 1027, 1027, 1005, 10047, 2290, 1005, 1007, 2709, 6270, 1025, 2709, 2969, 1012, 4871, 1012, 2070, 1006, 3853, 1006, 3746, 1007, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/dom/jquery/scrollRightRTL.js
function() { var oDomRef = this.get(0); if (oDomRef) { if (Device.browser.msie) { return oDomRef.scrollLeft; } else if (Device.browser.firefox || (Device.browser.safari && Device.browser.version >= 10)) { // Firefox and Safari 10+ behave the same although Safari is a WebKit browser return (-oDomRef.scrollLeft); } else if (Device.browser.webkit) { // WebKit browsers (except Safari 10+, as it's handled above) return oDomRef.scrollWidth - oDomRef.scrollLeft - oDomRef.clientWidth; } else { // unrecognized browser; it is hard to return a best guess, as browser strategies are very different, so return the actual value return oDomRef.scrollLeft; } } }
javascript
function() { var oDomRef = this.get(0); if (oDomRef) { if (Device.browser.msie) { return oDomRef.scrollLeft; } else if (Device.browser.firefox || (Device.browser.safari && Device.browser.version >= 10)) { // Firefox and Safari 10+ behave the same although Safari is a WebKit browser return (-oDomRef.scrollLeft); } else if (Device.browser.webkit) { // WebKit browsers (except Safari 10+, as it's handled above) return oDomRef.scrollWidth - oDomRef.scrollLeft - oDomRef.clientWidth; } else { // unrecognized browser; it is hard to return a best guess, as browser strategies are very different, so return the actual value return oDomRef.scrollLeft; } } }
[ "function", "(", ")", "{", "var", "oDomRef", "=", "this", ".", "get", "(", "0", ")", ";", "if", "(", "oDomRef", ")", "{", "if", "(", "Device", ".", "browser", ".", "msie", ")", "{", "return", "oDomRef", ".", "scrollLeft", ";", "}", "else", "if", ...
This module provides the {@link jQuery#scrollRightRTL} API. @namespace @name module:sap/ui/dom/jquery/scrollRightRTL @public @since 1.58 Returns the MIRRORED scrollLeft value of the first element in the given jQuery collection in right-to-left mode. Precondition: The element is rendered in RTL mode. Reason for this method is that the major browsers return three different values for the same scroll position when in RTL mode. This method hides those differences and returns the value that would be returned in LTR mode if the UI would be mirrored horizontally: The distance in px how far the given container is scrolled away from the rightmost scroll position. Returns "undefined" if no element is given. @return {int} The scroll position, counted from the rightmost position @public @name jQuery#scrollRightRTL @author SAP SE @since 0.20.0 @function @requires module:sap/ui/dom/jquery/scrollRightRTL
[ "This", "module", "provides", "the", "{", "@link", "jQuery#scrollRightRTL", "}", "API", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/dom/jquery/scrollRightRTL.js#L34-L54
train
Returns the current scroll left value of the element
[ 30522, 3853, 1006, 1007, 1063, 13075, 1051, 9527, 2890, 2546, 1027, 2023, 1012, 2131, 1006, 1014, 1007, 1025, 2065, 1006, 1051, 9527, 2890, 2546, 1007, 1063, 2065, 1006, 5080, 1012, 16602, 1012, 5796, 2666, 1007, 1063, 2709, 1051, 9527, 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...
adobe/brackets
src/editor/CodeHintManager.js
_updateHintList
function _updateHintList(callMoveUpEvent) { callMoveUpEvent = typeof callMoveUpEvent === "undefined" ? false : callMoveUpEvent; if (deferredHints) { deferredHints.reject(); deferredHints = null; } if (callMoveUpEvent) { return hintList.callMoveUp(callMoveUpEvent); } var response = sessionProvider.getHints(lastChar); lastChar = null; if (!response) { // the provider wishes to close the session _endSession(); } else { // if the response is true, end the session and begin another if (response === true) { var previousEditor = sessionEditor; _endSession(); _beginSession(previousEditor); } else if (response.hasOwnProperty("hints")) { // a synchronous response if (hintList.isOpen()) { // the session is open hintList.update(response); } else { hintList.open(response); } } else { // response is a deferred deferredHints = response; response.done(function (hints) { // Guard against timing issues where the session ends before the // response gets a chance to execute the callback. If the session // ends first while still waiting on the response, then hintList // will get cleared up. if (!hintList) { return; } if (hintList.isOpen()) { // the session is open hintList.update(hints); } else { hintList.open(hints); } }); } } }
javascript
function _updateHintList(callMoveUpEvent) { callMoveUpEvent = typeof callMoveUpEvent === "undefined" ? false : callMoveUpEvent; if (deferredHints) { deferredHints.reject(); deferredHints = null; } if (callMoveUpEvent) { return hintList.callMoveUp(callMoveUpEvent); } var response = sessionProvider.getHints(lastChar); lastChar = null; if (!response) { // the provider wishes to close the session _endSession(); } else { // if the response is true, end the session and begin another if (response === true) { var previousEditor = sessionEditor; _endSession(); _beginSession(previousEditor); } else if (response.hasOwnProperty("hints")) { // a synchronous response if (hintList.isOpen()) { // the session is open hintList.update(response); } else { hintList.open(response); } } else { // response is a deferred deferredHints = response; response.done(function (hints) { // Guard against timing issues where the session ends before the // response gets a chance to execute the callback. If the session // ends first while still waiting on the response, then hintList // will get cleared up. if (!hintList) { return; } if (hintList.isOpen()) { // the session is open hintList.update(hints); } else { hintList.open(hints); } }); } } }
[ "function", "_updateHintList", "(", "callMoveUpEvent", ")", "{", "callMoveUpEvent", "=", "typeof", "callMoveUpEvent", "===", "\"undefined\"", "?", "false", ":", "callMoveUpEvent", ";", "if", "(", "deferredHints", ")", "{", "deferredHints", ".", "reject", "(", ")",...
From an active hinting session, get hints from the current provider and render the hint list window. Assumes that it is called when a session is active (i.e. sessionProvider is not null).
[ "From", "an", "active", "hinting", "session", "get", "hints", "from", "the", "current", "provider", "and", "render", "the", "hint", "list", "window", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/CodeHintManager.js#L417-L470
train
Update the hint list
[ 30522, 3853, 1035, 10651, 10606, 19646, 2923, 1006, 2655, 5302, 3726, 6279, 18697, 3372, 1007, 1063, 2655, 5302, 3726, 6279, 18697, 3372, 1027, 2828, 11253, 2655, 5302, 3726, 6279, 18697, 3372, 1027, 1027, 1027, 1000, 6151, 28344, 1000, 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...
LLK/scratch-blocks
blocks_vertical/sound.js
function() { this.jsonInit({ "message0": Blockly.Msg.SOUND_CHANGEEFFECTBY, "args0": [ { "type": "field_dropdown", "name": "EFFECT", "options": [ [Blockly.Msg.SOUND_EFFECTS_PITCH, 'PITCH'], [Blockly.Msg.SOUND_EFFECTS_PAN, 'PAN'] ] }, { "type": "input_value", "name": "VALUE" } ], "category": Blockly.Categories.sound, "extensions": ["colours_sounds", "shape_statement"] }); }
javascript
function() { this.jsonInit({ "message0": Blockly.Msg.SOUND_CHANGEEFFECTBY, "args0": [ { "type": "field_dropdown", "name": "EFFECT", "options": [ [Blockly.Msg.SOUND_EFFECTS_PITCH, 'PITCH'], [Blockly.Msg.SOUND_EFFECTS_PAN, 'PAN'] ] }, { "type": "input_value", "name": "VALUE" } ], "category": Blockly.Categories.sound, "extensions": ["colours_sounds", "shape_statement"] }); }
[ "function", "(", ")", "{", "this", ".", "jsonInit", "(", "{", "\"message0\"", ":", "Blockly", ".", "Msg", ".", "SOUND_CHANGEEFFECTBY", ",", "\"args0\"", ":", "[", "{", "\"type\"", ":", "\"field_dropdown\"", ",", "\"name\"", ":", "\"EFFECT\"", ",", "\"options...
Block to change the audio effect @this Blockly.Block
[ "Block", "to", "change", "the", "audio", "effect" ]
455b2a854435c0a67da1da92320ddc3ec3e2b799
https://github.com/LLK/scratch-blocks/blob/455b2a854435c0a67da1da92320ddc3ec3e2b799/blocks_vertical/sound.js#L155-L175
train
Block for the change effect by.
[ 30522, 3853, 1006, 1007, 1063, 2023, 1012, 1046, 3385, 5498, 2102, 1006, 1063, 1000, 4471, 2692, 1000, 1024, 3796, 2135, 1012, 5796, 2290, 1012, 2614, 1035, 2689, 12879, 25969, 3762, 1010, 1000, 12098, 5620, 2692, 1000, 1024, 1031, 1063, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/view/Pane.js
Pane
function Pane(id, $container) { this._initialize(); // Setup the container and the element we're inserting var self = this, showPaneHeaderButtonsPref = PreferencesManager.get("pane.showPaneHeaderButtons"), $el = $container.append(Mustache.render(paneTemplate, {id: id})).find("#" + id), $header = $el.find(".pane-header"), $headerText = $header.find(".pane-header-text"), $headerFlipViewBtn = $header.find(".pane-header-flipview-btn"), $headerCloseBtn = $header.find(".pane-header-close-btn"), $content = $el.find(".pane-content"); $el.on("focusin.pane", function (e) { self._lastFocusedElement = e.target; }); // Flips the current file to the other pane when clicked $headerFlipViewBtn.on("click.pane", function (e) { var currentFile = self.getCurrentlyViewedFile(); var otherPaneId = self.id === FIRST_PANE ? SECOND_PANE : FIRST_PANE; var otherPane = MainViewManager._getPane(otherPaneId); var sameDocInOtherView = otherPane.getViewForPath(currentFile.fullPath); // If the same doc view is present in the destination, show the file instead of flipping it if (sameDocInOtherView) { CommandManager.execute(Commands.FILE_OPEN, {fullPath: currentFile.fullPath, paneId: otherPaneId}).always(function () { _ensurePaneIsFocused(otherPaneId); }); return; } // Currently active pane is not necessarily self.id as just clicking the button does not // give focus to the pane. This way it is possible to flip multiple panes to the active one // without losing focus. var activePaneIdBeforeFlip = MainViewManager.getActivePaneId(); MainViewManager._moveView(self.id, otherPaneId, currentFile).always(function () { CommandManager.execute(Commands.FILE_OPEN, {fullPath: currentFile.fullPath, paneId: otherPaneId}).always(function () { // Trigger view list changes for both panes self.trigger("viewListChange"); otherPane.trigger("viewListChange"); _ensurePaneIsFocused(activePaneIdBeforeFlip); }); }); }); // Closes the current view on the pane when clicked. If pane has no files, merge // panes. $headerCloseBtn.on("click.pane", function () { //set clicked pane as active to ensure that this._currentView is updated before closing MainViewManager.setActivePaneId(self.id); var file = self.getCurrentlyViewedFile(); if (file) { CommandManager.execute(Commands.FILE_CLOSE, {File: file, paneId: self.id}); if (!self.getCurrentlyViewedFile() && PreferencesManager.get("pane.mergePanesWhenLastFileClosed")) { MainViewManager.setLayoutScheme(1, 1); } } else { MainViewManager.setLayoutScheme(1, 1); } }); this._lastFocusedElement = $el[0]; // Make these properties read only Object.defineProperty(this, "id", { get: function () { return id; }, set: function () { console.error("cannot change the id of a working pane"); } }); Object.defineProperty(this, "$el", { get: function () { return $el; }, set: function () { console.error("cannot change the DOM node of a working pane"); } }); Object.defineProperty(this, "$header", { get: function () { return $header; }, set: function () { console.error("cannot change the DOM node of a working pane"); } }); Object.defineProperty(this, "$headerText", { get: function () { return $headerText; }, set: function () { console.error("cannot change the DOM node of a working pane"); } }); Object.defineProperty(this, "$headerFlipViewBtn", { get: function () { return $headerFlipViewBtn; }, set: function () { console.error("cannot change the DOM node of a working pane"); } }); Object.defineProperty(this, "$headerCloseBtn", { get: function () { return $headerCloseBtn; }, set: function () { console.error("cannot change the DOM node of a working pane"); } }); Object.defineProperty(this, "$content", { get: function () { return $content; }, set: function () { console.error("cannot change the DOM node of a working pane"); } }); Object.defineProperty(this, "$container", { get: function () { return $container; }, set: function () { console.error("cannot change the DOM node of a working pane"); } }); this.updateHeaderText(); switch (showPaneHeaderButtonsPref) { case "always": this.$header.addClass("always-show-header-buttons"); break; case "never": this.$headerFlipViewBtn.css("display", "none"); this.$headerCloseBtn.css("display", "none"); break; } // Listen to document events so we can update ourself DocumentManager.on(this._makeEventName("fileNameChange"), _.bind(this._handleFileNameChange, this)); DocumentManager.on(this._makeEventName("pathDeleted"), _.bind(this._handleFileDeleted, this)); MainViewManager.on(this._makeEventName("activePaneChange"), _.bind(this._handleActivePaneChange, this)); MainViewManager.on(this._makeEventName("workingSetAdd"), _.bind(this.updateHeaderText, this)); MainViewManager.on(this._makeEventName("workingSetRemove"), _.bind(this.updateHeaderText, this)); MainViewManager.on(this._makeEventName("workingSetAddList"), _.bind(this.updateHeaderText, this)); MainViewManager.on(this._makeEventName("workingSetRemoveList"), _.bind(this.updateHeaderText, this)); MainViewManager.on(this._makeEventName("paneLayoutChange"), _.bind(this.updateFlipViewIcon, this)); }
javascript
function Pane(id, $container) { this._initialize(); // Setup the container and the element we're inserting var self = this, showPaneHeaderButtonsPref = PreferencesManager.get("pane.showPaneHeaderButtons"), $el = $container.append(Mustache.render(paneTemplate, {id: id})).find("#" + id), $header = $el.find(".pane-header"), $headerText = $header.find(".pane-header-text"), $headerFlipViewBtn = $header.find(".pane-header-flipview-btn"), $headerCloseBtn = $header.find(".pane-header-close-btn"), $content = $el.find(".pane-content"); $el.on("focusin.pane", function (e) { self._lastFocusedElement = e.target; }); // Flips the current file to the other pane when clicked $headerFlipViewBtn.on("click.pane", function (e) { var currentFile = self.getCurrentlyViewedFile(); var otherPaneId = self.id === FIRST_PANE ? SECOND_PANE : FIRST_PANE; var otherPane = MainViewManager._getPane(otherPaneId); var sameDocInOtherView = otherPane.getViewForPath(currentFile.fullPath); // If the same doc view is present in the destination, show the file instead of flipping it if (sameDocInOtherView) { CommandManager.execute(Commands.FILE_OPEN, {fullPath: currentFile.fullPath, paneId: otherPaneId}).always(function () { _ensurePaneIsFocused(otherPaneId); }); return; } // Currently active pane is not necessarily self.id as just clicking the button does not // give focus to the pane. This way it is possible to flip multiple panes to the active one // without losing focus. var activePaneIdBeforeFlip = MainViewManager.getActivePaneId(); MainViewManager._moveView(self.id, otherPaneId, currentFile).always(function () { CommandManager.execute(Commands.FILE_OPEN, {fullPath: currentFile.fullPath, paneId: otherPaneId}).always(function () { // Trigger view list changes for both panes self.trigger("viewListChange"); otherPane.trigger("viewListChange"); _ensurePaneIsFocused(activePaneIdBeforeFlip); }); }); }); // Closes the current view on the pane when clicked. If pane has no files, merge // panes. $headerCloseBtn.on("click.pane", function () { //set clicked pane as active to ensure that this._currentView is updated before closing MainViewManager.setActivePaneId(self.id); var file = self.getCurrentlyViewedFile(); if (file) { CommandManager.execute(Commands.FILE_CLOSE, {File: file, paneId: self.id}); if (!self.getCurrentlyViewedFile() && PreferencesManager.get("pane.mergePanesWhenLastFileClosed")) { MainViewManager.setLayoutScheme(1, 1); } } else { MainViewManager.setLayoutScheme(1, 1); } }); this._lastFocusedElement = $el[0]; // Make these properties read only Object.defineProperty(this, "id", { get: function () { return id; }, set: function () { console.error("cannot change the id of a working pane"); } }); Object.defineProperty(this, "$el", { get: function () { return $el; }, set: function () { console.error("cannot change the DOM node of a working pane"); } }); Object.defineProperty(this, "$header", { get: function () { return $header; }, set: function () { console.error("cannot change the DOM node of a working pane"); } }); Object.defineProperty(this, "$headerText", { get: function () { return $headerText; }, set: function () { console.error("cannot change the DOM node of a working pane"); } }); Object.defineProperty(this, "$headerFlipViewBtn", { get: function () { return $headerFlipViewBtn; }, set: function () { console.error("cannot change the DOM node of a working pane"); } }); Object.defineProperty(this, "$headerCloseBtn", { get: function () { return $headerCloseBtn; }, set: function () { console.error("cannot change the DOM node of a working pane"); } }); Object.defineProperty(this, "$content", { get: function () { return $content; }, set: function () { console.error("cannot change the DOM node of a working pane"); } }); Object.defineProperty(this, "$container", { get: function () { return $container; }, set: function () { console.error("cannot change the DOM node of a working pane"); } }); this.updateHeaderText(); switch (showPaneHeaderButtonsPref) { case "always": this.$header.addClass("always-show-header-buttons"); break; case "never": this.$headerFlipViewBtn.css("display", "none"); this.$headerCloseBtn.css("display", "none"); break; } // Listen to document events so we can update ourself DocumentManager.on(this._makeEventName("fileNameChange"), _.bind(this._handleFileNameChange, this)); DocumentManager.on(this._makeEventName("pathDeleted"), _.bind(this._handleFileDeleted, this)); MainViewManager.on(this._makeEventName("activePaneChange"), _.bind(this._handleActivePaneChange, this)); MainViewManager.on(this._makeEventName("workingSetAdd"), _.bind(this.updateHeaderText, this)); MainViewManager.on(this._makeEventName("workingSetRemove"), _.bind(this.updateHeaderText, this)); MainViewManager.on(this._makeEventName("workingSetAddList"), _.bind(this.updateHeaderText, this)); MainViewManager.on(this._makeEventName("workingSetRemoveList"), _.bind(this.updateHeaderText, this)); MainViewManager.on(this._makeEventName("paneLayoutChange"), _.bind(this.updateFlipViewIcon, this)); }
[ "function", "Pane", "(", "id", ",", "$container", ")", "{", "this", ".", "_initialize", "(", ")", ";", "// Setup the container and the element we're inserting", "var", "self", "=", "this", ",", "showPaneHeaderButtonsPref", "=", "PreferencesManager", ".", "get", "(",...
@typedef {!$el: jQuery, getFile:function():!File, updateLayout:function(forceRefresh:boolean), destroy:function(), getScrollPos:function():?, adjustScrollPos:function(state:Object=, heightDelta:number)=, getViewState:function():?*=, restoreViewState:function(viewState:!*)=, notifyContainerChange:function()=, notifyVisibilityChange:function(boolean)=} View Pane Objects are constructed by the MainViewManager object when a Pane view is needed @see {@link MainViewManager} for more information @constructor @param {!string} id - The id to use to identify this pane @param {!JQuery} $container - The parent $container to place the pane view
[ "@typedef", "{", "!$el", ":", "jQuery", "getFile", ":", "function", "()", ":", "!File", "updateLayout", ":", "function", "(", "forceRefresh", ":", "boolean", ")", "destroy", ":", "function", "()", "getScrollPos", ":", "function", "()", ":", "?", "adjustScrol...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/Pane.js#L240-L403
train
Creates a new Pane instance
[ 30522, 3853, 6090, 2063, 1006, 8909, 1010, 1002, 11661, 1007, 1063, 2023, 1012, 1035, 3988, 4697, 1006, 1007, 1025, 1013, 1013, 16437, 1996, 11661, 1998, 1996, 5783, 2057, 1005, 2128, 19274, 2075, 13075, 2969, 1027, 2023, 1010, 30524, 28786...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SeleniumHQ/selenium
javascript/selenium-core/scripts/htmlutils.js
function( ua ) { ua = ua.toLowerCase(); var match = /(webkit)[ \/]([\w.]+)/.exec( ua ) || /(msie) ([\w.]+)/.exec( ua ) || !/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) || []; return { browser: match[1] || "", version: match[2] || "0" }; }
javascript
function( ua ) { ua = ua.toLowerCase(); var match = /(webkit)[ \/]([\w.]+)/.exec( ua ) || /(msie) ([\w.]+)/.exec( ua ) || !/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) || []; return { browser: match[1] || "", version: match[2] || "0" }; }
[ "function", "(", "ua", ")", "{", "ua", "=", "ua", ".", "toLowerCase", "(", ")", ";", "var", "match", "=", "/", "(webkit)[ \\/]([\\w.]+)", "/", ".", "exec", "(", "ua", ")", "||", "/", "(msie) ([\\w.]+)", "/", ".", "exec", "(", "ua", ")", "||", "!", ...
Use of jQuery.browser is frowned upon. More details: http://docs.jquery.com/Utilities/jQuery.browser
[ "Use", "of", "jQuery", ".", "browser", "is", "frowned", "upon", ".", "More", "details", ":", "http", ":", "//", "docs", ".", "jquery", ".", "com", "/", "Utilities", "/", "jQuery", ".", "browser" ]
38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd
https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/htmlutils.js#L3301-L3310
train
Get the browser and version from the user agent string
[ 30522, 3853, 1006, 25423, 1007, 1063, 25423, 1027, 25423, 1012, 2000, 27663, 18992, 3366, 1006, 1007, 1025, 13075, 2674, 1027, 1013, 1006, 4773, 23615, 1007, 1031, 1032, 1013, 1033, 1006, 1031, 1032, 1059, 1012, 1033, 1009, 1007, 1013, 1012...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/extensions/default/QuickOpenHTML/main.js
createIDList
function createIDList() { var doc = DocumentManager.getCurrentDocument(); if (!doc) { return; } var idList = []; var docText = doc.getText(); var lines = docText.split("\n"); var regex = new RegExp(/\s+id\s*?=\s*?["'](.*?)["']/gi); var id, chFrom, chTo, i, line; for (i = 0; i < lines.length; i++) { line = lines[i]; var info; while ((info = regex.exec(line)) !== null) { id = info[1]; // TODO: this doesn't handle id's that share the // same portion of a name on the same line or when // the id and value are on different lines chFrom = line.indexOf(id); chTo = chFrom + id.length; idList.push(new FileLocation(null, i, chFrom, chTo, id)); } } return idList; }
javascript
function createIDList() { var doc = DocumentManager.getCurrentDocument(); if (!doc) { return; } var idList = []; var docText = doc.getText(); var lines = docText.split("\n"); var regex = new RegExp(/\s+id\s*?=\s*?["'](.*?)["']/gi); var id, chFrom, chTo, i, line; for (i = 0; i < lines.length; i++) { line = lines[i]; var info; while ((info = regex.exec(line)) !== null) { id = info[1]; // TODO: this doesn't handle id's that share the // same portion of a name on the same line or when // the id and value are on different lines chFrom = line.indexOf(id); chTo = chFrom + id.length; idList.push(new FileLocation(null, i, chFrom, chTo, id)); } } return idList; }
[ "function", "createIDList", "(", ")", "{", "var", "doc", "=", "DocumentManager", ".", "getCurrentDocument", "(", ")", ";", "if", "(", "!", "doc", ")", "{", "return", ";", "}", "var", "idList", "=", "[", "]", ";", "var", "docText", "=", "doc", ".", ...
Returns a list of information about ID's for a single document. This array is populated by createIDList() @type {?Array.<FileLocation>}
[ "Returns", "a", "list", "of", "information", "about", "ID", "s", "for", "a", "single", "document", ".", "This", "array", "is", "populated", "by", "createIDList", "()" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/QuickOpenHTML/main.js#L58-L84
train
Create an array of FileLocations
[ 30522, 3853, 3443, 3593, 9863, 1006, 1007, 1063, 13075, 9986, 1027, 6254, 24805, 4590, 1012, 2131, 10841, 14343, 3372, 3527, 24894, 4765, 1006, 1007, 1025, 2065, 1006, 999, 9986, 1007, 1063, 2709, 1025, 1065, 13075, 8909, 9863, 1027, 1031, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
wangfupeng1988/wangEditor
src/js/editor/index.js
function () { // -------- 绑定 onchange 事件 -------- let onChangeTimeoutId = 0 let beforeChangeHtml = this.txt.html() const config = this.config // onchange 触发延迟时间 let onchangeTimeout = config.onchangeTimeout onchangeTimeout = parseInt(onchangeTimeout, 10) if (!onchangeTimeout || onchangeTimeout <= 0) { onchangeTimeout = 200 } const onchange = config.onchange if (onchange && typeof onchange === 'function'){ // 触发 change 的有三个场景: // 1. $textContainerElem.on('click keyup') // 2. $toolbarElem.on('click') // 3. editor.cmd.do() this.change = function () { // 判断是否有变化 let currentHtml = this.txt.html() if (currentHtml.length === beforeChangeHtml.length) { // 需要比较每一个字符 if (currentHtml === beforeChangeHtml) { return } } // 执行,使用节流 if (onChangeTimeoutId) { clearTimeout(onChangeTimeoutId) } onChangeTimeoutId = setTimeout(() => { // 触发配置的 onchange 函数 onchange(currentHtml) beforeChangeHtml = currentHtml }, onchangeTimeout) } } // -------- 绑定 onblur 事件 -------- const onblur = config.onblur if (onblur && typeof onblur === 'function') { this.onblur = function () { const currentHtml = this.txt.html() onblur(currentHtml) } } // -------- 绑定 onfocus 事件 -------- const onfocus = config.onfocus if (onfocus && typeof onfocus === 'function') { this.onfocus = function () { onfocus() } } }
javascript
function () { // -------- 绑定 onchange 事件 -------- let onChangeTimeoutId = 0 let beforeChangeHtml = this.txt.html() const config = this.config // onchange 触发延迟时间 let onchangeTimeout = config.onchangeTimeout onchangeTimeout = parseInt(onchangeTimeout, 10) if (!onchangeTimeout || onchangeTimeout <= 0) { onchangeTimeout = 200 } const onchange = config.onchange if (onchange && typeof onchange === 'function'){ // 触发 change 的有三个场景: // 1. $textContainerElem.on('click keyup') // 2. $toolbarElem.on('click') // 3. editor.cmd.do() this.change = function () { // 判断是否有变化 let currentHtml = this.txt.html() if (currentHtml.length === beforeChangeHtml.length) { // 需要比较每一个字符 if (currentHtml === beforeChangeHtml) { return } } // 执行,使用节流 if (onChangeTimeoutId) { clearTimeout(onChangeTimeoutId) } onChangeTimeoutId = setTimeout(() => { // 触发配置的 onchange 函数 onchange(currentHtml) beforeChangeHtml = currentHtml }, onchangeTimeout) } } // -------- 绑定 onblur 事件 -------- const onblur = config.onblur if (onblur && typeof onblur === 'function') { this.onblur = function () { const currentHtml = this.txt.html() onblur(currentHtml) } } // -------- 绑定 onfocus 事件 -------- const onfocus = config.onfocus if (onfocus && typeof onfocus === 'function') { this.onfocus = function () { onfocus() } } }
[ "function", "(", ")", "{", "// -------- 绑定 onchange 事件 --------", "let", "onChangeTimeoutId", "=", "0", "let", "beforeChangeHtml", "=", "this", ".", "txt", ".", "html", "(", ")", "const", "config", "=", "this", ".", "config", "// onchange 触发延迟时间", "let", "onchan...
绑定事件
[ "绑定事件" ]
b77696f5e81c8ec13d9d341252d6b9fa8a22db18
https://github.com/wangfupeng1988/wangEditor/blob/b77696f5e81c8ec13d9d341252d6b9fa8a22db18/src/js/editor/index.js#L242-L301
train
触发 change 事件
[ 30522, 3853, 1006, 1007, 1063, 1013, 1013, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 100, 1822, 2006, 22305, 2063, 1751, 100, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 2292, 2006, 22305, 20624, 26247, 21823, 2094, 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...
swimlane/ngx-datatable
release/utils/math.js
scaleColumns
function scaleColumns(colsByGroup, maxWidth, totalFlexGrow) { // calculate total width and flexgrow points for coulumns that can be resized for (var attr in colsByGroup) { for (var _i = 0, _a = colsByGroup[attr]; _i < _a.length; _i++) { var column = _a[_i]; if (!column.canAutoResize) { maxWidth -= column.width; totalFlexGrow -= column.flexGrow ? column.flexGrow : 0; } else { column.width = 0; } } } var hasMinWidth = {}; var remainingWidth = maxWidth; // resize columns until no width is left to be distributed do { var widthPerFlexPoint = remainingWidth / totalFlexGrow; remainingWidth = 0; for (var attr in colsByGroup) { for (var _b = 0, _c = colsByGroup[attr]; _b < _c.length; _b++) { var column = _c[_b]; // if the column can be resize and it hasn't reached its minimum width yet if (column.canAutoResize && !hasMinWidth[column.prop]) { var newWidth = column.width + column.flexGrow * widthPerFlexPoint; if (column.minWidth !== undefined && newWidth < column.minWidth) { remainingWidth += newWidth - column.minWidth; column.width = column.minWidth; hasMinWidth[column.prop] = true; } else { column.width = newWidth; } } } } } while (remainingWidth !== 0); }
javascript
function scaleColumns(colsByGroup, maxWidth, totalFlexGrow) { // calculate total width and flexgrow points for coulumns that can be resized for (var attr in colsByGroup) { for (var _i = 0, _a = colsByGroup[attr]; _i < _a.length; _i++) { var column = _a[_i]; if (!column.canAutoResize) { maxWidth -= column.width; totalFlexGrow -= column.flexGrow ? column.flexGrow : 0; } else { column.width = 0; } } } var hasMinWidth = {}; var remainingWidth = maxWidth; // resize columns until no width is left to be distributed do { var widthPerFlexPoint = remainingWidth / totalFlexGrow; remainingWidth = 0; for (var attr in colsByGroup) { for (var _b = 0, _c = colsByGroup[attr]; _b < _c.length; _b++) { var column = _c[_b]; // if the column can be resize and it hasn't reached its minimum width yet if (column.canAutoResize && !hasMinWidth[column.prop]) { var newWidth = column.width + column.flexGrow * widthPerFlexPoint; if (column.minWidth !== undefined && newWidth < column.minWidth) { remainingWidth += newWidth - column.minWidth; column.width = column.minWidth; hasMinWidth[column.prop] = true; } else { column.width = newWidth; } } } } } while (remainingWidth !== 0); }
[ "function", "scaleColumns", "(", "colsByGroup", ",", "maxWidth", ",", "totalFlexGrow", ")", "{", "// calculate total width and flexgrow points for coulumns that can be resized", "for", "(", "var", "attr", "in", "colsByGroup", ")", "{", "for", "(", "var", "_i", "=", "0...
Resizes columns based on the flexGrow property, while respecting manually set widths
[ "Resizes", "columns", "based", "on", "the", "flexGrow", "property", "while", "respecting", "manually", "set", "widths" ]
d7df15a070282a169524dba51d9572008b74804c
https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/math.js#L32-L70
train
Scales columns by flexgrow
[ 30522, 3853, 4094, 25778, 2819, 3619, 1006, 8902, 14478, 17058, 1010, 4098, 9148, 11927, 2232, 1010, 2561, 21031, 2595, 16523, 5004, 1007, 1063, 1013, 1013, 18422, 2561, 9381, 1998, 23951, 16523, 5004, 2685, 2005, 2522, 25100, 3619, 2008, 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.documentation/src/sap/ui/documentation/sdk/controller/BaseController.js
function (sControlName, oControlsData) { var oLibComponentModel = oControlsData.libComponentInfos, oLibInfo = library._getLibraryInfoSingleton(); return oLibInfo._getActualComponent(oLibComponentModel, sControlName); }
javascript
function (sControlName, oControlsData) { var oLibComponentModel = oControlsData.libComponentInfos, oLibInfo = library._getLibraryInfoSingleton(); return oLibInfo._getActualComponent(oLibComponentModel, sControlName); }
[ "function", "(", "sControlName", ",", "oControlsData", ")", "{", "var", "oLibComponentModel", "=", "oControlsData", ".", "libComponentInfos", ",", "oLibInfo", "=", "library", ".", "_getLibraryInfoSingleton", "(", ")", ";", "return", "oLibInfo", ".", "_getActualCompo...
Retrieves the actual component for the control. @param {string} sControlName @return {string} the actual component
[ "Retrieves", "the", "actual", "component", "for", "the", "control", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/BaseController.js#L159-L163
train
Returns the actual component for the given control name.
[ 30522, 3853, 1006, 30524, 3075, 1012, 1035, 2131, 29521, 19848, 25811, 14876, 7741, 19263, 1006, 1007, 1025, 2709, 19330, 12322, 2378, 14876, 1012, 1035, 2131, 18908, 8787, 9006, 29513, 3372, 1006, 19330, 12322, 9006, 29513, 3372, 5302, 9247,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/babel-plugin-relay/createTransformError.js
createTransformError
function createTransformError(error: any): string { if (error instanceof RelayTransformError) { return `Relay Transform Error: ${error.message}`; } const {sourceText, validationErrors} = error; if (validationErrors && sourceText) { const sourceLines = sourceText.split('\n'); return validationErrors .map(({message, locations}) => { return ( 'GraphQL Validation Error: ' + message + '\n' + locations .map(location => { const preview = sourceLines[location.line - 1]; return ( preview && [ '>', '> ' + preview, '> ' + ' '.repeat(location.column - 1) + '^^^', ].join('\n') ); }) .filter(Boolean) .join('\n') ); }) .join('\n'); } return util.format( 'Relay Transform Error: %s\n\n%s', error.message, error.stack, ); }
javascript
function createTransformError(error: any): string { if (error instanceof RelayTransformError) { return `Relay Transform Error: ${error.message}`; } const {sourceText, validationErrors} = error; if (validationErrors && sourceText) { const sourceLines = sourceText.split('\n'); return validationErrors .map(({message, locations}) => { return ( 'GraphQL Validation Error: ' + message + '\n' + locations .map(location => { const preview = sourceLines[location.line - 1]; return ( preview && [ '>', '> ' + preview, '> ' + ' '.repeat(location.column - 1) + '^^^', ].join('\n') ); }) .filter(Boolean) .join('\n') ); }) .join('\n'); } return util.format( 'Relay Transform Error: %s\n\n%s', error.message, error.stack, ); }
[ "function", "createTransformError", "(", "error", ":", "any", ")", ":", "string", "{", "if", "(", "error", "instanceof", "RelayTransformError", ")", "{", "return", "`", "${", "error", ".", "message", "}", "`", ";", "}", "const", "{", "sourceText", ",", "...
In case of an error during transform, determine if it should be logged to the console and/or printed in the source.
[ "In", "case", "of", "an", "error", "during", "transform", "determine", "if", "it", "should", "be", "logged", "to", "the", "console", "and", "/", "or", "printed", "in", "the", "source", "." ]
7fb9be5182b9650637d7b92ead9a42713ac30aa4
https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/babel-plugin-relay/createTransformError.js#L21-L59
train
Creates a string that can be used to create a transform error.
[ 30522, 3853, 3443, 6494, 3619, 14192, 2121, 29165, 1006, 7561, 1024, 2151, 1007, 1024, 5164, 1063, 2065, 1006, 7561, 6013, 11253, 8846, 6494, 3619, 14192, 2121, 29165, 1007, 1063, 2709, 1036, 8846, 10938, 7561, 1024, 1002, 1063, 7561, 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...
GoogleChrome/workbox
packages/workbox-webpack-plugin/src/lib/get-manifest-entries-from-compilation.js
getEntry
function getEntry(knownHashes, url, revision) { // We're assuming that if the URL contains any of the known hashes // (either the short or full chunk hash or compilation hash) then it's // already revisioned, and we don't need additional out-of-band revisioning. if (!revision || knownHashes.some((hash) => url.includes(hash))) { return {url}; } return {revision, url}; }
javascript
function getEntry(knownHashes, url, revision) { // We're assuming that if the URL contains any of the known hashes // (either the short or full chunk hash or compilation hash) then it's // already revisioned, and we don't need additional out-of-band revisioning. if (!revision || knownHashes.some((hash) => url.includes(hash))) { return {url}; } return {revision, url}; }
[ "function", "getEntry", "(", "knownHashes", ",", "url", ",", "revision", ")", "{", "// We're assuming that if the URL contains any of the known hashes", "// (either the short or full chunk hash or compilation hash) then it's", "// already revisioned, and we don't need additional out-of-band ...
A single manifest entry that Workbox can precache. When possible, we leave out the revision information, which tells Workbox that the URL contains enough info to uniquely version the asset. @param {Array<string>} knownHashes All of the hashes that are associated with this webpack build. @param {string} url webpack asset url path @param {string} [revision] A revision hash for the entry @return {module:workbox-build.ManifestEntry} A single manifest entry @private
[ "A", "single", "manifest", "entry", "that", "Workbox", "can", "precache", ".", "When", "possible", "we", "leave", "out", "the", "revision", "information", "which", "tells", "Workbox", "that", "the", "URL", "contains", "enough", "info", "to", "uniquely", "versi...
8379c51b6deaf52faed5879206fe84579cae41f0
https://github.com/GoogleChrome/workbox/blob/8379c51b6deaf52faed5879206fe84579cae41f0/packages/workbox-webpack-plugin/src/lib/get-manifest-entries-from-compilation.js#L27-L35
train
Get the entry for a given URL
[ 30522, 3853, 2131, 4765, 2854, 1006, 2124, 14949, 15689, 1010, 24471, 2140, 1010, 13921, 1007, 1063, 1013, 1013, 2057, 1005, 2128, 10262, 2008, 2065, 1996, 24471, 2140, 3397, 2151, 1997, 1996, 2124, 23325, 2229, 1013, 1013, 1006, 2593, 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...
jgraph/mxgraph
javascript/mxClient.js
mxSwimlaneLayout
function mxSwimlaneLayout(graph, orientation, deterministic) { mxGraphLayout.call(this, graph); this.orientation = (orientation != null) ? orientation : mxConstants.DIRECTION_NORTH; this.deterministic = (deterministic != null) ? deterministic : true; }
javascript
function mxSwimlaneLayout(graph, orientation, deterministic) { mxGraphLayout.call(this, graph); this.orientation = (orientation != null) ? orientation : mxConstants.DIRECTION_NORTH; this.deterministic = (deterministic != null) ? deterministic : true; }
[ "function", "mxSwimlaneLayout", "(", "graph", ",", "orientation", ",", "deterministic", ")", "{", "mxGraphLayout", ".", "call", "(", "this", ",", "graph", ")", ";", "this", ".", "orientation", "=", "(", "orientation", "!=", "null", ")", "?", "orientation", ...
Copyright (c) 2006-2015, JGraph Ltd Copyright (c) 2006-2015, Gaudenz Alder Class: mxSwimlaneLayout A hierarchical layout algorithm. Constructor: mxSwimlaneLayout Constructs a new hierarchical layout algorithm. Arguments: graph - Reference to the enclosing <mxGraph>. orientation - Optional constant that defines the orientation of this layout. deterministic - Optional boolean that specifies if this layout should be deterministic. Default is true.
[ "Copyright", "(", "c", ")", "2006", "-", "2015", "JGraph", "Ltd", "Copyright", "(", "c", ")", "2006", "-", "2015", "Gaudenz", "Alder", "Class", ":", "mxSwimlaneLayout" ]
33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44
https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L38348-L38353
train
The layout for the swimlane.
[ 30522, 3853, 25630, 26760, 5714, 20644, 8485, 5833, 1006, 10629, 1010, 10296, 1010, 28283, 25300, 10074, 1007, 1063, 25630, 14413, 8485, 5833, 1012, 2655, 1006, 2023, 1010, 10629, 1007, 1025, 2023, 1012, 10296, 1027, 1006, 10296, 999, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/preferences/PreferencesBase.js
function (id, value, options, doNotSave) { options = options || {}; var context = this._getContext(options.context), // The case where the "default" scope was chosen specifically is special. // Usually "default" would come up only when a preference did not have any // user-set value, in which case we'd want to set the value in a different scope. forceDefault = options.location && options.location.scope === "default" ? true : false, location = options.location || this.getPreferenceLocation(id, context); if (!location || (location.scope === "default" && !forceDefault)) { var scopeOrder = this._getScopeOrder(context); // The default scope for setting a preference is the lowest priority // scope after "default". if (scopeOrder.length > 1) { location = { scope: scopeOrder[scopeOrder.length - 2] }; } else { return { valid: true, stored: false }; } } var scope = this._scopes[location.scope]; if (!scope) { return { valid: true, stored: false }; } var pref = this.getPreference(id), validator = pref && pref.validator; if (validator && !validator(value)) { return { valid: false, stored: false }; } var wasSet = scope.set(id, value, context, location); if (wasSet) { if (!doNotSave) { this.save(); } this._triggerChange({ ids: [id] }); } return { valid: true, stored: wasSet }; }
javascript
function (id, value, options, doNotSave) { options = options || {}; var context = this._getContext(options.context), // The case where the "default" scope was chosen specifically is special. // Usually "default" would come up only when a preference did not have any // user-set value, in which case we'd want to set the value in a different scope. forceDefault = options.location && options.location.scope === "default" ? true : false, location = options.location || this.getPreferenceLocation(id, context); if (!location || (location.scope === "default" && !forceDefault)) { var scopeOrder = this._getScopeOrder(context); // The default scope for setting a preference is the lowest priority // scope after "default". if (scopeOrder.length > 1) { location = { scope: scopeOrder[scopeOrder.length - 2] }; } else { return { valid: true, stored: false }; } } var scope = this._scopes[location.scope]; if (!scope) { return { valid: true, stored: false }; } var pref = this.getPreference(id), validator = pref && pref.validator; if (validator && !validator(value)) { return { valid: false, stored: false }; } var wasSet = scope.set(id, value, context, location); if (wasSet) { if (!doNotSave) { this.save(); } this._triggerChange({ ids: [id] }); } return { valid: true, stored: wasSet }; }
[ "function", "(", "id", ",", "value", ",", "options", ",", "doNotSave", ")", "{", "options", "=", "options", "||", "{", "}", ";", "var", "context", "=", "this", ".", "_getContext", "(", "options", ".", "context", ")", ",", "// The case where the \"default\"...
Sets a preference and notifies listeners that there may have been a change. By default, the preference is set in the same location in which it was defined except for the "default" scope. If the current value of the preference comes from the "default" scope, the new value will be set at the level just above default. @param {string} id Identifier of the preference to set @param {Object} value New value for the preference @param {{location: ?Object, context: ?Object}=} options Specific location in which to set the value or the context to use when setting the value @param {boolean=} doNotSave True if the preference change should not be saved automatically. @return {valid: {boolean}, true if no validator specified or if value is valid stored: {boolean}} true if a value was stored
[ "Sets", "a", "preference", "and", "notifies", "listeners", "that", "there", "may", "have", "been", "a", "change", ".", "By", "default", "the", "preference", "is", "set", "in", "the", "same", "location", "in", "which", "it", "was", "defined", "except", "for...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1721-L1766
train
Sets a preference in the specified context.
[ 30522, 3853, 1006, 8909, 1010, 3643, 1010, 7047, 1010, 2123, 12868, 10696, 1007, 1063, 7047, 1027, 7047, 1064, 1064, 1063, 1065, 1025, 13075, 6123, 1027, 2023, 1012, 1035, 2131, 8663, 18209, 1006, 7047, 1012, 6123, 1007, 1010, 1013, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
nhn/tui.editor
src/js/extensions/table/unmergeCell.js
_updateMergedCells
function _updateMergedCells(tableData, startRowIndex, startColIndex, rowspan, colspan) { const limitRowIndex = startRowIndex + rowspan; const limitColIndex = startColIndex + colspan; const colRange = util.range(startColIndex, limitColIndex); util.range(startRowIndex, limitRowIndex).forEach(rowIndex => { const rowData = tableData[rowIndex]; const startIndex = (rowIndex === startRowIndex) ? 1 : 0; colRange.slice(startIndex).forEach(colIndex => { rowData[colIndex] = dataHandler.createBasicCell(rowIndex, colIndex, rowData[colIndex].nodeName); }); }); }
javascript
function _updateMergedCells(tableData, startRowIndex, startColIndex, rowspan, colspan) { const limitRowIndex = startRowIndex + rowspan; const limitColIndex = startColIndex + colspan; const colRange = util.range(startColIndex, limitColIndex); util.range(startRowIndex, limitRowIndex).forEach(rowIndex => { const rowData = tableData[rowIndex]; const startIndex = (rowIndex === startRowIndex) ? 1 : 0; colRange.slice(startIndex).forEach(colIndex => { rowData[colIndex] = dataHandler.createBasicCell(rowIndex, colIndex, rowData[colIndex].nodeName); }); }); }
[ "function", "_updateMergedCells", "(", "tableData", ",", "startRowIndex", ",", "startColIndex", ",", "rowspan", ",", "colspan", ")", "{", "const", "limitRowIndex", "=", "startRowIndex", "+", "rowspan", ";", "const", "limitColIndex", "=", "startColIndex", "+", "col...
Update merged cell data to basic cell data. @param {Array.<Array.<object>>} tableData - table data @param {number} startRowIndex - start row index @param {number} startColIndex - start col index @param {number} rowspan - rowspan property of merger cell @param {number} colspan - colspan property of merger cell @private
[ "Update", "merged", "cell", "data", "to", "basic", "cell", "data", "." ]
e75ab08c2a7ab07d1143e318f7cde135c5e3002e
https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/table/unmergeCell.js#L79-L92
train
Update merged cells
[ 30522, 3853, 1035, 10651, 5017, 5999, 29109, 4877, 1006, 2795, 2850, 2696, 1010, 2707, 10524, 22254, 10288, 1010, 2707, 25778, 22254, 10288, 1010, 10281, 9739, 1010, 8902, 13102, 2319, 1007, 1063, 9530, 3367, 5787, 10524, 22254, 10288, 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...
exceljs/exceljs
lib/csv/line-buffer.js
function(chunk) { // find line or lines in chunk and emit them if not corked // or queue them if corked var data = this.buffer ? this.buffer + chunk : chunk; var lines = data.split(/\r?\n/g); // save the last line this.buffer = lines.pop(); lines.forEach(function(line) { if (this.corked) { this.queue.push(line); } else { this.emit('line', line); } }); return !this.corked; }
javascript
function(chunk) { // find line or lines in chunk and emit them if not corked // or queue them if corked var data = this.buffer ? this.buffer + chunk : chunk; var lines = data.split(/\r?\n/g); // save the last line this.buffer = lines.pop(); lines.forEach(function(line) { if (this.corked) { this.queue.push(line); } else { this.emit('line', line); } }); return !this.corked; }
[ "function", "(", "chunk", ")", "{", "// find line or lines in chunk and emit them if not corked", "// or queue them if corked", "var", "data", "=", "this", ".", "buffer", "?", "this", ".", "buffer", "+", "chunk", ":", "chunk", ";", "var", "lines", "=", "data", "."...
Events: line: here is a line done: all lines emitted
[ "Events", ":", "line", ":", "here", "is", "a", "line", "done", ":", "all", "lines", "emitted" ]
c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2
https://github.com/exceljs/exceljs/blob/c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2/lib/csv/line-buffer.js#L24-L42
train
process a chunk of data
[ 30522, 3853, 1006, 20000, 1007, 1063, 1013, 1013, 2424, 2240, 2030, 3210, 1999, 20000, 1998, 12495, 2102, 2068, 2065, 2025, 8513, 2098, 1013, 1013, 2030, 24240, 2068, 2065, 8513, 2098, 13075, 2951, 1027, 2023, 1012, 17698, 1029, 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...
dequelabs/axe-core
lib/commons/text/form-control-value.js
ariaRangeValue
function ariaRangeValue(node) { node = node.actualNode || node; const role = aria.getRole(node); if (!rangeRoles.includes(role) || !node.hasAttribute('aria-valuenow')) { return ''; } // Validate the number, if not, return 0. // Chrome 70 typecasts this, Firefox 62 does not const valueNow = +node.getAttribute('aria-valuenow'); return !isNaN(valueNow) ? String(valueNow) : '0'; }
javascript
function ariaRangeValue(node) { node = node.actualNode || node; const role = aria.getRole(node); if (!rangeRoles.includes(role) || !node.hasAttribute('aria-valuenow')) { return ''; } // Validate the number, if not, return 0. // Chrome 70 typecasts this, Firefox 62 does not const valueNow = +node.getAttribute('aria-valuenow'); return !isNaN(valueNow) ? String(valueNow) : '0'; }
[ "function", "ariaRangeValue", "(", "node", ")", "{", "node", "=", "node", ".", "actualNode", "||", "node", ";", "const", "role", "=", "aria", ".", "getRole", "(", "node", ")", ";", "if", "(", "!", "rangeRoles", ".", "includes", "(", "role", ")", "||"...
Calculate value of an element with range-type role @param {VirtualNode|Node} element The VirtualNode instance whose value we want @return {string} The calculated value
[ "Calculate", "value", "of", "an", "element", "with", "range", "-", "type", "role" ]
727323c07980e2291575f545444d389fb942906f
https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/commons/text/form-control-value.js#L194-L204
train
Get the value of the range element
[ 30522, 3853, 9342, 24388, 13331, 7630, 2063, 1006, 13045, 1007, 1063, 13045, 1027, 13045, 1012, 5025, 3630, 3207, 1064, 1064, 13045, 1025, 9530, 3367, 2535, 1027, 9342, 1012, 2131, 13153, 2063, 1006, 13045, 1007, 1025, 2065, 1006, 999, 1150...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Async.js
doInParallel
function doInParallel(items, beginProcessItem, failFast) { var promises = []; var masterDeferred = new $.Deferred(); if (items.length === 0) { masterDeferred.resolve(); } else { var numCompleted = 0; var hasFailed = false; items.forEach(function (item, i) { var itemPromise = beginProcessItem(item, i); promises.push(itemPromise); itemPromise.fail(function () { if (failFast) { masterDeferred.reject(); } else { hasFailed = true; } }); itemPromise.always(function () { numCompleted++; if (numCompleted === items.length) { if (hasFailed) { masterDeferred.reject(); } else { masterDeferred.resolve(); } } }); }); } return masterDeferred.promise(); }
javascript
function doInParallel(items, beginProcessItem, failFast) { var promises = []; var masterDeferred = new $.Deferred(); if (items.length === 0) { masterDeferred.resolve(); } else { var numCompleted = 0; var hasFailed = false; items.forEach(function (item, i) { var itemPromise = beginProcessItem(item, i); promises.push(itemPromise); itemPromise.fail(function () { if (failFast) { masterDeferred.reject(); } else { hasFailed = true; } }); itemPromise.always(function () { numCompleted++; if (numCompleted === items.length) { if (hasFailed) { masterDeferred.reject(); } else { masterDeferred.resolve(); } } }); }); } return masterDeferred.promise(); }
[ "function", "doInParallel", "(", "items", ",", "beginProcessItem", ",", "failFast", ")", "{", "var", "promises", "=", "[", "]", ";", "var", "masterDeferred", "=", "new", "$", ".", "Deferred", "(", ")", ";", "if", "(", "items", ".", "length", "===", "0"...
Further ideas for Async utilities... - Utilities for blocking UI until a Promise completes? - A "SuperDeferred" could feature some very useful enhancements: - API for cancellation (non guaranteed, best attempt) - Easier way to add a timeout clause (withTimeout() wrapper below is more verbose) - Encapsulate the task kickoff code so you can start it later, e.g. superDeferred.start() - Deferred/Promise are unable to do anything akin to a 'finally' block. It'd be nice if we could harvest exceptions across all steps of an async process and pipe them to a handler, so that we don't leave UI-blocking overlays up forever, etc. But this is hard: we'd have wrap every async callback (including low-level native ones that don't use [Super]Deferred) to catch exceptions, and then understand which Deferred(s) the code *would* have resolved/ rejected had it run to completion. Executes a series of tasks in parallel, returning a "master" Promise that is resolved once all the tasks have resolved. If one or more tasks fail, behavior depends on the failFast flag: - If true, the master Promise is rejected as soon as the first task fails. The remaining tasks continue to completion in the background. - If false, the master Promise is rejected after all tasks have completed. If nothing fails: (M = master promise; 1-4 = tasks; d = done; F = fail) M ------------d 1 >---d . 2 >------d . 3 >---------d . 4 >------------d With failFast = false: M ------------F 1 >---d . . 2 >------d . . 3 >---------F . 4 >------------d With failFast = true: -- equivalent to $.when() M ---------F 1 >---d . 2 >------d . 3 >---------F 4 >------------d (#4 continues even though master Promise has failed) (Note: if tasks finish synchronously, the behavior is more like failFast=false because you won't get a chance to respond to the master Promise until after all items have been processed) To perform task-specific work after an individual task completes, attach handlers to each Promise before beginProcessItem() returns it. Note: don't use this if individual tasks (or their done/fail handlers) could ever show a user- visible dialog: because they run in parallel, you could show multiple dialogs atop each other. @param {!Array.<*>} items @param {!function(*, number):Promise} beginProcessItem @param {!boolean} failFast @return {$.Promise}
[ "Further", "ideas", "for", "Async", "utilities", "...", "-", "Utilities", "for", "blocking", "UI", "until", "a", "Promise", "completes?", "-", "A", "SuperDeferred", "could", "feature", "some", "very", "useful", "enhancements", ":", "-", "API", "for", "cancella...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/Async.js#L86-L123
train
In parallel processes the items in parallel
[ 30522, 3853, 24341, 28689, 6216, 2140, 1006, 5167, 1010, 4088, 21572, 9623, 28032, 6633, 1010, 8246, 24333, 1007, 1063, 30524, 2842, 1063, 13075, 16371, 12458, 25377, 25890, 2094, 1027, 1014, 1025, 13075, 2038, 7011, 18450, 1027, 6270, 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...
Freeboard/freeboard
js/freeboard.plugins.js
function(settings, updateCallback) { // Always a good idea... var self = this; // Good idea to create a variable to hold on to our settings, because they might change in the future. See below. var currentSettings = settings; /* This is some function where I'll get my data from somewhere */ function getData() { var conn = skynet.createConnection({ "uuid": currentSettings.uuid, "token": currentSettings.token, "server": currentSettings.server, "port": currentSettings.port }); conn.on('ready', function(data){ conn.on('message', function(message){ var newData = message; updateCallback(newData); }); }); } // **onSettingsChanged(newSettings)** (required) : A public function we must implement that will be called when a user makes a change to the settings. self.onSettingsChanged = function(newSettings) { // Here we update our current settings with the variable that is passed in. currentSettings = newSettings; } // **updateNow()** (required) : A public function we must implement that will be called when the user wants to manually refresh the datasource self.updateNow = function() { // Most likely I'll just call getData() here. getData(); } // **onDispose()** (required) : A public function we must implement that will be called when this instance of this plugin is no longer needed. Do anything you need to cleanup after yourself here. self.onDispose = function() { //conn.close(); } // Here we call createRefreshTimer with our current settings, to kick things off, initially. Notice how we make use of one of the user defined settings that we setup earlier. // createRefreshTimer(currentSettings.refresh_time); }
javascript
function(settings, updateCallback) { // Always a good idea... var self = this; // Good idea to create a variable to hold on to our settings, because they might change in the future. See below. var currentSettings = settings; /* This is some function where I'll get my data from somewhere */ function getData() { var conn = skynet.createConnection({ "uuid": currentSettings.uuid, "token": currentSettings.token, "server": currentSettings.server, "port": currentSettings.port }); conn.on('ready', function(data){ conn.on('message', function(message){ var newData = message; updateCallback(newData); }); }); } // **onSettingsChanged(newSettings)** (required) : A public function we must implement that will be called when a user makes a change to the settings. self.onSettingsChanged = function(newSettings) { // Here we update our current settings with the variable that is passed in. currentSettings = newSettings; } // **updateNow()** (required) : A public function we must implement that will be called when the user wants to manually refresh the datasource self.updateNow = function() { // Most likely I'll just call getData() here. getData(); } // **onDispose()** (required) : A public function we must implement that will be called when this instance of this plugin is no longer needed. Do anything you need to cleanup after yourself here. self.onDispose = function() { //conn.close(); } // Here we call createRefreshTimer with our current settings, to kick things off, initially. Notice how we make use of one of the user defined settings that we setup earlier. // createRefreshTimer(currentSettings.refresh_time); }
[ "function", "(", "settings", ",", "updateCallback", ")", "{", "// Always a good idea...", "var", "self", "=", "this", ";", "// Good idea to create a variable to hold on to our settings, because they might change in the future. See below.", "var", "currentSettings", "=", "settings",...
### Datasource Implementation ------------------- Here we implement the actual datasource plugin. We pass in the settings and updateCallback.
[ "###", "Datasource", "Implementation", "-------------------", "Here", "we", "implement", "the", "actual", "datasource", "plugin", ".", "We", "pass", "in", "the", "settings", "and", "updateCallback", "." ]
38789f6e8bd3d04f7d3b2c3427e509d00f2610fc
https://github.com/Freeboard/freeboard/blob/38789f6e8bd3d04f7d3b2c3427e509d00f2610fc/js/freeboard.plugins.js#L589-L650
train
This plugin is a public function that will get the data from the database.
[ 30522, 3853, 1006, 10906, 1010, 10651, 9289, 20850, 8684, 1007, 1063, 1013, 1013, 2467, 1037, 2204, 2801, 1012, 1012, 1012, 13075, 2969, 1027, 2023, 1025, 1013, 1013, 2204, 2801, 2000, 3443, 1037, 8023, 2000, 2907, 2006, 2000, 2256, 10906, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
angular/material
src/core/util/animation/animate.js
function (element, opts) { var TIMEOUT = 3000; // fallback is 3 secs return $q(function(resolve, reject){ opts = opts || { }; // If there is no transition is found, resolve immediately // // NOTE: using $mdUtil.nextTick() causes delays/issues if (noTransitionFound(opts.cachedTransitionStyles)) { TIMEOUT = 0; } var timer = $timeout(finished, opts.timeout || TIMEOUT); element.on($mdConstant.CSS.TRANSITIONEND, finished); /** * Upon timeout or transitionEnd, reject or resolve (respectively) this promise. * NOTE: Make sure this transitionEnd didn't bubble up from a child */ function finished(ev) { if (ev && ev.target !== element[0]) return; if (ev) $timeout.cancel(timer); element.off($mdConstant.CSS.TRANSITIONEND, finished); // Never reject since ngAnimate may cause timeouts due missed transitionEnd events resolve(); } /** * Checks whether or not there is a transition. * * @param styles The cached styles to use for the calculation. If null, getComputedStyle() * will be used. * * @returns {boolean} True if there is no transition/duration; false otherwise. */ function noTransitionFound(styles) { styles = styles || window.getComputedStyle(element[0]); return styles.transitionDuration == '0s' || (!styles.transition && !styles.transitionProperty); } }); }
javascript
function (element, opts) { var TIMEOUT = 3000; // fallback is 3 secs return $q(function(resolve, reject){ opts = opts || { }; // If there is no transition is found, resolve immediately // // NOTE: using $mdUtil.nextTick() causes delays/issues if (noTransitionFound(opts.cachedTransitionStyles)) { TIMEOUT = 0; } var timer = $timeout(finished, opts.timeout || TIMEOUT); element.on($mdConstant.CSS.TRANSITIONEND, finished); /** * Upon timeout or transitionEnd, reject or resolve (respectively) this promise. * NOTE: Make sure this transitionEnd didn't bubble up from a child */ function finished(ev) { if (ev && ev.target !== element[0]) return; if (ev) $timeout.cancel(timer); element.off($mdConstant.CSS.TRANSITIONEND, finished); // Never reject since ngAnimate may cause timeouts due missed transitionEnd events resolve(); } /** * Checks whether or not there is a transition. * * @param styles The cached styles to use for the calculation. If null, getComputedStyle() * will be used. * * @returns {boolean} True if there is no transition/duration; false otherwise. */ function noTransitionFound(styles) { styles = styles || window.getComputedStyle(element[0]); return styles.transitionDuration == '0s' || (!styles.transition && !styles.transitionProperty); } }); }
[ "function", "(", "element", ",", "opts", ")", "{", "var", "TIMEOUT", "=", "3000", ";", "// fallback is 3 secs", "return", "$q", "(", "function", "(", "resolve", ",", "reject", ")", "{", "opts", "=", "opts", "||", "{", "}", ";", "// If there is no transitio...
Listen for transitionEnd event (with optional timeout) Announce completion or failure via promise handlers
[ "Listen", "for", "transitionEnd", "event", "(", "with", "optional", "timeout", ")", "Announce", "completion", "or", "failure", "via", "promise", "handlers" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/animation/animate.js#L55-L101
train
Returns a promise that resolves when there is no transition found.
[ 30522, 3853, 1006, 5783, 1010, 23569, 2015, 1007, 1063, 13075, 2051, 5833, 1027, 11910, 1025, 1013, 1013, 2991, 5963, 2003, 1017, 10819, 2015, 2709, 1002, 1053, 1006, 3853, 1006, 10663, 1010, 15454, 1007, 1063, 23569, 2015, 1027, 23569, 201...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/systems/material.js
function (material) { var materials = this.materials; Object.keys(materials).forEach(function (uuid) { materials[uuid].needsUpdate = true; }); }
javascript
function (material) { var materials = this.materials; Object.keys(materials).forEach(function (uuid) { materials[uuid].needsUpdate = true; }); }
[ "function", "(", "material", ")", "{", "var", "materials", "=", "this", ".", "materials", ";", "Object", ".", "keys", "(", "materials", ")", ".", "forEach", "(", "function", "(", "uuid", ")", "{", "materials", "[", "uuid", "]", ".", "needsUpdate", "=",...
Trigger update to all registered materials.
[ "Trigger", "update", "to", "all", "registered", "materials", "." ]
24acc78a7299a4cdfe3ef617f4d40ddf6275c992
https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/systems/material.js#L227-L232
train
Update the material
[ 30522, 3853, 1006, 3430, 1007, 1063, 13075, 4475, 1027, 2023, 1012, 4475, 1025, 4874, 1012, 6309, 1006, 4475, 1007, 1012, 18921, 6776, 1006, 3853, 1006, 1057, 21272, 1007, 1063, 4475, 1031, 1057, 21272, 1033, 1012, 3791, 6279, 13701, 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...