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
aws/aws-sdk-js
lib/service.js
getSignerClass
function getSignerClass(request) { var version; // get operation authtype if present var operation = null; var authtype = ''; if (request) { var operations = request.service.api.operations || {}; operation = operations[request.operation] || null; authtype = operation ? operation.authtype : ''; } if (this.config.signatureVersion) { version = this.config.signatureVersion; } else if (authtype === 'v4' || authtype === 'v4-unsigned-body') { version = 'v4'; } else { version = this.api.signatureVersion; } return AWS.Signers.RequestSigner.getVersion(version); }
javascript
function getSignerClass(request) { var version; // get operation authtype if present var operation = null; var authtype = ''; if (request) { var operations = request.service.api.operations || {}; operation = operations[request.operation] || null; authtype = operation ? operation.authtype : ''; } if (this.config.signatureVersion) { version = this.config.signatureVersion; } else if (authtype === 'v4' || authtype === 'v4-unsigned-body') { version = 'v4'; } else { version = this.api.signatureVersion; } return AWS.Signers.RequestSigner.getVersion(version); }
[ "function", "getSignerClass", "(", "request", ")", "{", "var", "version", ";", "// get operation authtype if present", "var", "operation", "=", "null", ";", "var", "authtype", "=", "''", ";", "if", "(", "request", ")", "{", "var", "operations", "=", "request",...
Gets the signer class for a given request @api private
[ "Gets", "the", "signer", "class", "for", "a", "given", "request" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/service.js#L459-L477
train
Get the signer class for the given request
[ 30522, 3853, 4152, 23773, 2121, 26266, 1006, 5227, 1007, 1063, 13075, 2544, 1025, 1013, 1013, 2131, 3169, 8740, 2705, 13874, 2065, 2556, 13075, 3169, 1027, 19701, 1025, 13075, 8740, 2705, 13874, 1027, 1005, 1005, 1025, 2065, 1006, 5227, 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/NetworkAgent.js
_onFrameNavigated
function _onFrameNavigated(event, res) { // res = {frame} // Clear log when navigating to a new page, but not if an iframe was loaded if (!res.frame.parentId) { _reset(); } _logURL(res.frame.url); }
javascript
function _onFrameNavigated(event, res) { // res = {frame} // Clear log when navigating to a new page, but not if an iframe was loaded if (!res.frame.parentId) { _reset(); } _logURL(res.frame.url); }
[ "function", "_onFrameNavigated", "(", "event", ",", "res", ")", "{", "// res = {frame}", "// Clear log when navigating to a new page, but not if an iframe was loaded", "if", "(", "!", "res", ".", "frame", ".", "parentId", ")", "{", "_reset", "(", ")", ";", "}", "_lo...
WebInspector Event: Page.frameNavigated
[ "WebInspector", "Event", ":", "Page", ".", "frameNavigated" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/NetworkAgent.js#L68-L75
train
Called when a frame is navigated
[ 30522, 3853, 1035, 2006, 15643, 2532, 5737, 11644, 1006, 2724, 1010, 24501, 1007, 1063, 1013, 1013, 24501, 1027, 1063, 4853, 30524, 2019, 2065, 6444, 2063, 2001, 8209, 2065, 1006, 999, 24501, 1012, 4853, 1012, 6687, 3593, 1007, 1063, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/core/date/Persian.js
toGregorian
function toGregorian(oPersian) { var iJulianDayNumber = j2d(oPersian.year, oPersian.month + 1, oPersian.day); return d2g(iJulianDayNumber); }
javascript
function toGregorian(oPersian) { var iJulianDayNumber = j2d(oPersian.year, oPersian.month + 1, oPersian.day); return d2g(iJulianDayNumber); }
[ "function", "toGregorian", "(", "oPersian", ")", "{", "var", "iJulianDayNumber", "=", "j2d", "(", "oPersian", ".", "year", ",", "oPersian", ".", "month", "+", "1", ",", "oPersian", ".", "day", ")", ";", "return", "d2g", "(", "iJulianDayNumber", ")", ";",...
Calculate gregorian date from Persian @param {object} oPersian a JS object containing day, month and year in the Persian calendar @private
[ "Calculate", "gregorian", "date", "from", "Persian" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/date/Persian.js#L61-L64
train
Converts Persian to gregorian
[ 30522, 3853, 2000, 17603, 20255, 2937, 1006, 6728, 2545, 2937, 1007, 1063, 13075, 1045, 9103, 15204, 10259, 19172, 5677, 1027, 1046, 2475, 2094, 1006, 6728, 2545, 2937, 1012, 2095, 1010, 6728, 2545, 2937, 1012, 3204, 1009, 1015, 1010, 6728,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/code-prettify
tasks/lib/lang-aliases.js
createSandbox
function createSandbox() { // collect registered language extensions var sandbox = {}; sandbox.extensions = []; // mock prettify.js API sandbox.window = {}; sandbox.window.PR = sandbox.PR = { registerLangHandler: function (handler, exts) { sandbox.extensions = sandbox.extensions.concat(exts); }, createSimpleLexer: function (sPatterns, fPatterns) { return function (job) {}; }, sourceDecorator: function (options) { return function (job) {}; }, prettyPrintOne: function (src, lang, ln) { return src; }, prettyPrint: function (done, root) {}, PR_ATTRIB_NAME: 'atn', PR_ATTRIB_VALUE: 'atv', PR_COMMENT: 'com', PR_DECLARATION: 'dec', PR_KEYWORD: 'kwd', PR_LITERAL: 'lit', PR_NOCODE: 'nocode', PR_PLAIN: 'pln', PR_PUNCTUATION: 'pun', PR_SOURCE: 'src', PR_STRING: 'str', PR_TAG: 'tag', PR_TYPE: 'typ' }; return sandbox; }
javascript
function createSandbox() { // collect registered language extensions var sandbox = {}; sandbox.extensions = []; // mock prettify.js API sandbox.window = {}; sandbox.window.PR = sandbox.PR = { registerLangHandler: function (handler, exts) { sandbox.extensions = sandbox.extensions.concat(exts); }, createSimpleLexer: function (sPatterns, fPatterns) { return function (job) {}; }, sourceDecorator: function (options) { return function (job) {}; }, prettyPrintOne: function (src, lang, ln) { return src; }, prettyPrint: function (done, root) {}, PR_ATTRIB_NAME: 'atn', PR_ATTRIB_VALUE: 'atv', PR_COMMENT: 'com', PR_DECLARATION: 'dec', PR_KEYWORD: 'kwd', PR_LITERAL: 'lit', PR_NOCODE: 'nocode', PR_PLAIN: 'pln', PR_PUNCTUATION: 'pun', PR_SOURCE: 'src', PR_STRING: 'str', PR_TAG: 'tag', PR_TYPE: 'typ' }; return sandbox; }
[ "function", "createSandbox", "(", ")", "{", "// collect registered language extensions", "var", "sandbox", "=", "{", "}", ";", "sandbox", ".", "extensions", "=", "[", "]", ";", "// mock prettify.js API", "sandbox", ".", "window", "=", "{", "}", ";", "sandbox", ...
Returns a mock object PR of the prettify API. This is used to collect registered language file extensions. @return {Object} PR object with an additional `extensions` property.
[ "Returns", "a", "mock", "object", "PR", "of", "the", "prettify", "API", ".", "This", "is", "used", "to", "collect", "registered", "language", "file", "extensions", "." ]
e14ed1c3c40f78fca2a11af4cb0fa251f6f997fc
https://github.com/google/code-prettify/blob/e14ed1c3c40f78fca2a11af4cb0fa251f6f997fc/tasks/lib/lang-aliases.js#L19-L54
train
Creates a sandbox object
[ 30522, 3853, 9005, 5685, 8758, 1006, 1007, 1063, 1013, 1013, 8145, 5068, 2653, 14305, 13075, 5472, 8758, 1027, 1063, 1065, 1025, 5472, 8758, 1012, 14305, 1027, 1031, 1033, 1025, 1013, 1013, 12934, 3653, 6916, 12031, 1012, 1046, 2015, 17928,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
eslint/eslint
lib/rules/no-extra-parens.js
checkExpressionOrExportStatement
function checkExpressionOrExportStatement(node) { const firstToken = isParenthesised(node) ? sourceCode.getTokenBefore(node) : sourceCode.getFirstToken(node); const secondToken = sourceCode.getTokenAfter(firstToken, astUtils.isNotOpeningParenToken); const thirdToken = secondToken ? sourceCode.getTokenAfter(secondToken) : null; const tokenAfterClosingParens = secondToken ? sourceCode.getTokenAfter(secondToken, astUtils.isNotClosingParenToken) : null; if ( astUtils.isOpeningParenToken(firstToken) && ( astUtils.isOpeningBraceToken(secondToken) || secondToken.type === "Keyword" && ( secondToken.value === "function" || secondToken.value === "class" || secondToken.value === "let" && tokenAfterClosingParens && ( astUtils.isOpeningBracketToken(tokenAfterClosingParens) || tokenAfterClosingParens.type === "Identifier" ) ) || secondToken && secondToken.type === "Identifier" && secondToken.value === "async" && thirdToken && thirdToken.type === "Keyword" && thirdToken.value === "function" ) ) { tokensToIgnore.add(secondToken); } if (hasExcessParens(node)) { report(node); } }
javascript
function checkExpressionOrExportStatement(node) { const firstToken = isParenthesised(node) ? sourceCode.getTokenBefore(node) : sourceCode.getFirstToken(node); const secondToken = sourceCode.getTokenAfter(firstToken, astUtils.isNotOpeningParenToken); const thirdToken = secondToken ? sourceCode.getTokenAfter(secondToken) : null; const tokenAfterClosingParens = secondToken ? sourceCode.getTokenAfter(secondToken, astUtils.isNotClosingParenToken) : null; if ( astUtils.isOpeningParenToken(firstToken) && ( astUtils.isOpeningBraceToken(secondToken) || secondToken.type === "Keyword" && ( secondToken.value === "function" || secondToken.value === "class" || secondToken.value === "let" && tokenAfterClosingParens && ( astUtils.isOpeningBracketToken(tokenAfterClosingParens) || tokenAfterClosingParens.type === "Identifier" ) ) || secondToken && secondToken.type === "Identifier" && secondToken.value === "async" && thirdToken && thirdToken.type === "Keyword" && thirdToken.value === "function" ) ) { tokensToIgnore.add(secondToken); } if (hasExcessParens(node)) { report(node); } }
[ "function", "checkExpressionOrExportStatement", "(", "node", ")", "{", "const", "firstToken", "=", "isParenthesised", "(", "node", ")", "?", "sourceCode", ".", "getTokenBefore", "(", "node", ")", ":", "sourceCode", ".", "getFirstToken", "(", "node", ")", ";", ...
Checks the parentheses for an ExpressionStatement or ExportDefaultDeclaration @param {ASTNode} node The ExpressionStatement.expression or ExportDefaultDeclaration.declaration node @returns {void}
[ "Checks", "the", "parentheses", "for", "an", "ExpressionStatement", "or", "ExportDefaultDeclaration" ]
bc0819c94aad14f7fad3cbc2338ea15658b0f272
https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-extra-parens.js#L470-L499
train
Check if the node is an expression or export statement
[ 30522, 3853, 4638, 10288, 30524, 4783, 29278, 2063, 1006, 13045, 1007, 1024, 3120, 16044, 1012, 2131, 8873, 12096, 18715, 2368, 1006, 13045, 1007, 1025, 9530, 3367, 2117, 18715, 2368, 1027, 3120, 16044, 1012, 2131, 18715, 8189, 6199, 2121, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/core/BlockLayerUtils.js
createTabbable
function createTabbable(fnRedirectFocus) { var oBlockSpan = document.createElement("span"); oBlockSpan.setAttribute("tabindex", 0); oBlockSpan.addEventListener('focusin', fnRedirectFocus); return oBlockSpan; }
javascript
function createTabbable(fnRedirectFocus) { var oBlockSpan = document.createElement("span"); oBlockSpan.setAttribute("tabindex", 0); oBlockSpan.addEventListener('focusin', fnRedirectFocus); return oBlockSpan; }
[ "function", "createTabbable", "(", "fnRedirectFocus", ")", "{", "var", "oBlockSpan", "=", "document", ".", "createElement", "(", "\"span\"", ")", ";", "oBlockSpan", ".", "setAttribute", "(", "\"tabindex\"", ",", "0", ")", ";", "oBlockSpan", ".", "addEventListene...
Create a tabbable span for the block section of the control with according focus handling. @param {function} fnRedirectFocus Focus handling function @returns {object} The span element's DOM node @private
[ "Create", "a", "tabbable", "span", "for", "the", "block", "section", "of", "the", "control", "with", "according", "focus", "handling", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/BlockLayerUtils.js#L262-L269
train
Creates a tabbable element.
[ 30522, 3853, 3443, 2696, 22414, 3468, 1006, 1042, 16118, 2098, 7442, 6593, 14876, 7874, 1007, 1063, 13075, 27885, 7878, 13102, 2319, 1027, 6254, 1012, 3443, 12260, 3672, 1006, 1000, 8487, 1000, 1007, 1025, 27885, 7878, 13102, 2319, 1012, 22...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
TryGhost/Ghost
core/server/adapters/scheduling/SchedulingDefault.js
SchedulingDefault
function SchedulingDefault(options) { SchedulingBase.call(this, options); // NOTE: How often should the scheduler wake up? this.runTimeoutInMs = 1000 * 60 * 5; // NOTE: An offset between now and past, which helps us choosing jobs which need to be executed soon. this.offsetInMinutes = 10; this.beforePingInMs = -50; this.retryTimeoutInMs = 1000 * 5; // NOTE: Each scheduler implementation can decide whether to load scheduled posts on bootstrap or not. this.rescheduleOnBoot = true; // NOTE: A sorted list of all scheduled jobs. this.allJobs = {}; this.deletedJobs = {}; this.isRunning = false; }
javascript
function SchedulingDefault(options) { SchedulingBase.call(this, options); // NOTE: How often should the scheduler wake up? this.runTimeoutInMs = 1000 * 60 * 5; // NOTE: An offset between now and past, which helps us choosing jobs which need to be executed soon. this.offsetInMinutes = 10; this.beforePingInMs = -50; this.retryTimeoutInMs = 1000 * 5; // NOTE: Each scheduler implementation can decide whether to load scheduled posts on bootstrap or not. this.rescheduleOnBoot = true; // NOTE: A sorted list of all scheduled jobs. this.allJobs = {}; this.deletedJobs = {}; this.isRunning = false; }
[ "function", "SchedulingDefault", "(", "options", ")", "{", "SchedulingBase", ".", "call", "(", "this", ",", "options", ")", ";", "// NOTE: How often should the scheduler wake up?", "this", ".", "runTimeoutInMs", "=", "1000", "*", "60", "*", "5", ";", "// NOTE: An ...
@description Default post scheduling implementation. The default scheduler is used for all self-hosted blogs. It is implemented with pure javascript (timers). "node-cron" did not perform well enough and we really just needed a simple time management. @param {Objec†} options @constructor
[ "@description", "Default", "post", "scheduling", "implementation", "." ]
bb7bb55cf3e60af99ebbc56099928827b58461bc
https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/adapters/scheduling/SchedulingDefault.js#L19-L38
train
The scheduler implementation that does not run any scheduled jobs.
[ 30522, 3853, 19940, 3207, 7011, 11314, 1006, 7047, 1007, 1063, 19940, 15058, 1012, 2655, 1006, 2023, 1010, 7047, 1007, 1025, 1013, 1013, 3602, 1024, 2129, 2411, 2323, 1996, 6134, 2099, 5256, 2039, 1029, 2023, 1012, 2448, 7292, 5833, 2378, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Batch.js
_deserializeBatchResponse
function _deserializeBatchResponse(sContentType, sResponseBody, bIsChangeSet) { var aBatchParts = sResponseBody.split(getBoundaryRegExp(sContentType)), aResponses = []; // skip preamble and epilogue aBatchParts = aBatchParts.slice(1, -1); aBatchParts.forEach(function (sBatchPart) { var sChangeSetContentType, sCharset, iColonIndex, sHeader, sHeaderName, sHeaderValue, aHttpHeaders, aHttpStatusInfos, i, sMimeHeaders, oResponse = {}, iResponseIndex, aResponseParts; // aResponseParts will take 3 elements: // 0: general batch part headers // 1: HTTP response headers and status line // 2: HTTP response body aResponseParts = sBatchPart.split("\r\n\r\n"); sMimeHeaders = aResponseParts[0]; sChangeSetContentType = getChangeSetContentType(sMimeHeaders); if (sChangeSetContentType) { aResponses.push(_deserializeBatchResponse(sChangeSetContentType, aResponseParts.slice(1).join("\r\n\r\n"), true)); return; } aHttpHeaders = aResponseParts[1].split("\r\n"); // e.g. HTTP/1.1 200 OK aHttpStatusInfos = aHttpHeaders[0].split(" "); oResponse.status = parseInt(aHttpStatusInfos[1]); oResponse.statusText = aHttpStatusInfos.slice(2).join(' '); oResponse.headers = {}; // start with index 1 to skip status line for (i = 1; i < aHttpHeaders.length; i += 1) { // e.g. Content-Type: application/json;odata.metadata=minimal sHeader = aHttpHeaders[i]; iColonIndex = sHeader.indexOf(':'); sHeaderName = sHeader.slice(0, iColonIndex).trim(); sHeaderValue = sHeader.slice(iColonIndex + 1).trim(); oResponse.headers[sHeaderName] = sHeaderValue; if (sHeaderName.toLowerCase() === "content-type") { sCharset = getHeaderParameterValue(sHeaderValue, "charset"); if (sCharset && sCharset.toLowerCase() !== "utf-8") { throw new Error('Unsupported "Content-Type" charset: ' + sCharset); } } } // remove \r\n sequence from the end of the response body oResponse.responseText = aResponseParts[2].slice(0, -2); if (bIsChangeSet) { iResponseIndex = getChangeSetResponseIndex(sMimeHeaders); aResponses[iResponseIndex] = oResponse; } else { aResponses.push(oResponse); } }); return aResponses; }
javascript
function _deserializeBatchResponse(sContentType, sResponseBody, bIsChangeSet) { var aBatchParts = sResponseBody.split(getBoundaryRegExp(sContentType)), aResponses = []; // skip preamble and epilogue aBatchParts = aBatchParts.slice(1, -1); aBatchParts.forEach(function (sBatchPart) { var sChangeSetContentType, sCharset, iColonIndex, sHeader, sHeaderName, sHeaderValue, aHttpHeaders, aHttpStatusInfos, i, sMimeHeaders, oResponse = {}, iResponseIndex, aResponseParts; // aResponseParts will take 3 elements: // 0: general batch part headers // 1: HTTP response headers and status line // 2: HTTP response body aResponseParts = sBatchPart.split("\r\n\r\n"); sMimeHeaders = aResponseParts[0]; sChangeSetContentType = getChangeSetContentType(sMimeHeaders); if (sChangeSetContentType) { aResponses.push(_deserializeBatchResponse(sChangeSetContentType, aResponseParts.slice(1).join("\r\n\r\n"), true)); return; } aHttpHeaders = aResponseParts[1].split("\r\n"); // e.g. HTTP/1.1 200 OK aHttpStatusInfos = aHttpHeaders[0].split(" "); oResponse.status = parseInt(aHttpStatusInfos[1]); oResponse.statusText = aHttpStatusInfos.slice(2).join(' '); oResponse.headers = {}; // start with index 1 to skip status line for (i = 1; i < aHttpHeaders.length; i += 1) { // e.g. Content-Type: application/json;odata.metadata=minimal sHeader = aHttpHeaders[i]; iColonIndex = sHeader.indexOf(':'); sHeaderName = sHeader.slice(0, iColonIndex).trim(); sHeaderValue = sHeader.slice(iColonIndex + 1).trim(); oResponse.headers[sHeaderName] = sHeaderValue; if (sHeaderName.toLowerCase() === "content-type") { sCharset = getHeaderParameterValue(sHeaderValue, "charset"); if (sCharset && sCharset.toLowerCase() !== "utf-8") { throw new Error('Unsupported "Content-Type" charset: ' + sCharset); } } } // remove \r\n sequence from the end of the response body oResponse.responseText = aResponseParts[2].slice(0, -2); if (bIsChangeSet) { iResponseIndex = getChangeSetResponseIndex(sMimeHeaders); aResponses[iResponseIndex] = oResponse; } else { aResponses.push(oResponse); } }); return aResponses; }
[ "function", "_deserializeBatchResponse", "(", "sContentType", ",", "sResponseBody", ",", "bIsChangeSet", ")", "{", "var", "aBatchParts", "=", "sResponseBody", ".", "split", "(", "getBoundaryRegExp", "(", "sContentType", ")", ")", ",", "aResponses", "=", "[", "]", ...
/* See JSDoc for oBatch.deserializeBatchResponse. Additional parameter bIsChangeSet indicates whether sResponseBody represents a change set.
[ "/", "*", "See", "JSDoc", "for", "oBatch", ".", "deserializeBatchResponse", ".", "Additional", "parameter", "bIsChangeSet", "indicates", "whether", "sResponseBody", "represents", "a", "change", "set", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Batch.js#L136-L209
train
Deserialize a batch response
[ 30522, 3853, 1035, 4078, 11610, 3669, 4371, 14479, 2818, 6072, 26029, 3366, 1006, 8040, 28040, 3372, 13874, 1010, 5034, 2229, 26029, 3366, 23684, 1010, 20377, 22305, 6810, 2102, 1007, 1063, 13075, 19557, 30524, 26950, 1012, 14704, 1006, 1015,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
TryGhost/Ghost
core/server/api/v0.1/authentication.js
assertSetupCompleted
function assertSetupCompleted(status) { return function checkPermission(__) { return checkSetup().then((isSetup) => { if (isSetup === status) { return __; } const completed = common.i18n.t('errors.api.authentication.setupAlreadyCompleted'), notCompleted = common.i18n.t('errors.api.authentication.setupMustBeCompleted'); function throwReason(reason) { throw new common.errors.NoPermissionError({message: reason}); } if (isSetup) { throwReason(completed); } else { throwReason(notCompleted); } }); }; }
javascript
function assertSetupCompleted(status) { return function checkPermission(__) { return checkSetup().then((isSetup) => { if (isSetup === status) { return __; } const completed = common.i18n.t('errors.api.authentication.setupAlreadyCompleted'), notCompleted = common.i18n.t('errors.api.authentication.setupMustBeCompleted'); function throwReason(reason) { throw new common.errors.NoPermissionError({message: reason}); } if (isSetup) { throwReason(completed); } else { throwReason(notCompleted); } }); }; }
[ "function", "assertSetupCompleted", "(", "status", ")", "{", "return", "function", "checkPermission", "(", "__", ")", "{", "return", "checkSetup", "(", ")", ".", "then", "(", "(", "isSetup", ")", "=>", "{", "if", "(", "isSetup", "===", "status", ")", "{"...
Allows an assertion to be made about setup status. @param {Boolean} status True: setup must be complete. False: setup must not be complete. @return {Function} returns a "task ready" function
[ "Allows", "an", "assertion", "to", "be", "made", "about", "setup", "status", "." ]
bb7bb55cf3e60af99ebbc56099928827b58461bc
https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/api/v0.1/authentication.js#L37-L58
train
Assert setup is completed
[ 30522, 3853, 19514, 3388, 6279, 9006, 10814, 3064, 1006, 3570, 1007, 1063, 2709, 3853, 4638, 4842, 25481, 1006, 1035, 1035, 1007, 1063, 2709, 14148, 3388, 6279, 1006, 1007, 1012, 2059, 1006, 1006, 26354, 3388, 6279, 1007, 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...
adobe/brackets
src/view/ThemeView.js
updateThemes
function updateThemes(cm) { var newTheme = prefs.get("theme"), cmTheme = (cm.getOption("theme") || "").replace(/[\s]*/, ""); // Normalize themes string // Check if the editor already has the theme applied... if (cmTheme === newTheme) { return; } // Setup current and further documents to get the new theme... CodeMirror.defaults.theme = newTheme; cm.setOption("theme", newTheme); }
javascript
function updateThemes(cm) { var newTheme = prefs.get("theme"), cmTheme = (cm.getOption("theme") || "").replace(/[\s]*/, ""); // Normalize themes string // Check if the editor already has the theme applied... if (cmTheme === newTheme) { return; } // Setup current and further documents to get the new theme... CodeMirror.defaults.theme = newTheme; cm.setOption("theme", newTheme); }
[ "function", "updateThemes", "(", "cm", ")", "{", "var", "newTheme", "=", "prefs", ".", "get", "(", "\"theme\"", ")", ",", "cmTheme", "=", "(", "cm", ".", "getOption", "(", "\"theme\"", ")", "||", "\"\"", ")", ".", "replace", "(", "/", "[\\s]*", "/", ...
Handles updating codemirror with the current selection of themes. @param {CodeMirror} cm is the CodeMirror instance currently loaded
[ "Handles", "updating", "codemirror", "with", "the", "current", "selection", "of", "themes", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/ThemeView.js#L56-L68
train
Update the theme of the codemirror editor
[ 30522, 3853, 10651, 10760, 7834, 1006, 4642, 1007, 1063, 13075, 25597, 29122, 2063, 1027, 3653, 10343, 1012, 2131, 1006, 1000, 4323, 1000, 1007, 1010, 4642, 10760, 4168, 1027, 1006, 4642, 1012, 2131, 7361, 3508, 1006, 1000, 4323, 1000, 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/_vendor/popper.js/dist/popper.js
getOppositePlacement
function getOppositePlacement(placement) { const hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; return placement.replace(/left|right|bottom|top/g, matched => hash[matched]); }
javascript
function getOppositePlacement(placement) { const hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; return placement.replace(/left|right|bottom|top/g, matched => hash[matched]); }
[ "function", "getOppositePlacement", "(", "placement", ")", "{", "const", "hash", "=", "{", "left", ":", "'right'", ",", "right", ":", "'left'", ",", "bottom", ":", "'top'", ",", "top", ":", "'bottom'", "}", ";", "return", "placement", ".", "replace", "("...
Get the opposite placement of the given one @method @memberof Popper.Utils @argument {String} placement @returns {String} flipped placement
[ "Get", "the", "opposite", "placement", "of", "the", "given", "one" ]
a913e4992dad8f7bf38df2e1d3f4cc6bfe5f26dd
https://github.com/thomaspark/bootswatch/blob/a913e4992dad8f7bf38df2e1d3f4cc6bfe5f26dd/docs/_vendor/popper.js/dist/popper.js#L695-L698
train
Get the opposite placement of a placement
[ 30522, 3853, 2131, 7361, 6873, 28032, 13699, 19217, 3672, 1006, 11073, 1007, 1063, 9530, 3367, 23325, 1027, 1063, 2187, 1024, 1005, 2157, 1005, 1010, 2157, 1024, 1005, 2187, 1005, 1010, 3953, 1024, 1005, 2327, 1005, 1010, 2327, 1024, 1005, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
tgriesser/knex
src/query/compiler.js
QueryCompiler
function QueryCompiler(client, builder) { this.client = client; this.method = builder._method || 'select'; this.options = builder._options; this.single = builder._single; this.timeout = builder._timeout || false; this.cancelOnTimeout = builder._cancelOnTimeout || false; this.grouped = groupBy(builder._statements, 'grouping'); this.formatter = client.formatter(builder); }
javascript
function QueryCompiler(client, builder) { this.client = client; this.method = builder._method || 'select'; this.options = builder._options; this.single = builder._single; this.timeout = builder._timeout || false; this.cancelOnTimeout = builder._cancelOnTimeout || false; this.grouped = groupBy(builder._statements, 'grouping'); this.formatter = client.formatter(builder); }
[ "function", "QueryCompiler", "(", "client", ",", "builder", ")", "{", "this", ".", "client", "=", "client", ";", "this", ".", "method", "=", "builder", ".", "_method", "||", "'select'", ";", "this", ".", "options", "=", "builder", ".", "_options", ";", ...
The "QueryCompiler" takes all of the query statements which have been gathered in the "QueryBuilder" and turns them into a properly formatted / bound query string.
[ "The", "QueryCompiler", "takes", "all", "of", "the", "query", "statements", "which", "have", "been", "gathered", "in", "the", "QueryBuilder", "and", "turns", "them", "into", "a", "properly", "formatted", "/", "bound", "query", "string", "." ]
6a4fecfe7822442ee5c43d924958eadfe6e17a93
https://github.com/tgriesser/knex/blob/6a4fecfe7822442ee5c43d924958eadfe6e17a93/src/query/compiler.js#L29-L38
train
A query compiler.
[ 30522, 3853, 23032, 9006, 22090, 2099, 1006, 7396, 1010, 12508, 1007, 1063, 2023, 1012, 7396, 1027, 7396, 1025, 2023, 1012, 4118, 1027, 12508, 1012, 1035, 4118, 1064, 1064, 1005, 7276, 1005, 1025, 2023, 1012, 7047, 1027, 12508, 1012, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.m/src/sap/m/TimePickerSlider.js
findIndexInArray
function findIndexInArray(aArray, fnPredicate) { if (aArray == null) { throw new TypeError('findIndex called with null or undefined array'); } if (typeof fnPredicate !== 'function') { throw new TypeError('predicate must be a function'); } var iLength = aArray.length; var fnThisArg = arguments[1]; var vValue; for (var iIndex = 0; iIndex < iLength; iIndex++) { vValue = aArray[iIndex]; if (fnPredicate.call(fnThisArg, vValue, iIndex, aArray)) { return iIndex; } } return -1; }
javascript
function findIndexInArray(aArray, fnPredicate) { if (aArray == null) { throw new TypeError('findIndex called with null or undefined array'); } if (typeof fnPredicate !== 'function') { throw new TypeError('predicate must be a function'); } var iLength = aArray.length; var fnThisArg = arguments[1]; var vValue; for (var iIndex = 0; iIndex < iLength; iIndex++) { vValue = aArray[iIndex]; if (fnPredicate.call(fnThisArg, vValue, iIndex, aArray)) { return iIndex; } } return -1; }
[ "function", "findIndexInArray", "(", "aArray", ",", "fnPredicate", ")", "{", "if", "(", "aArray", "==", "null", ")", "{", "throw", "new", "TypeError", "(", "'findIndex called with null or undefined array'", ")", ";", "}", "if", "(", "typeof", "fnPredicate", "!==...
Finds the index of an element, satisfying provided predicate. @param {array} aArray The array to be predicted @param {function} fnPredicate Testing function @returns {number} The index in the array, if an element in the array satisfies the provided testing function @private
[ "Finds", "the", "index", "of", "an", "element", "satisfying", "provided", "predicate", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/TimePickerSlider.js#L1210-L1229
train
Finds the index of the first element of an array that satisfies a predicate
[ 30522, 3853, 2424, 22254, 10288, 3981, 11335, 2100, 1006, 9779, 11335, 2100, 1010, 1042, 16275, 5596, 24695, 1007, 1063, 2065, 1006, 9779, 11335, 2100, 1027, 1027, 19701, 1007, 1063, 5466, 2047, 2828, 2121, 29165, 1006, 1005, 2424, 22254, 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...
fengyuanchen/cropper
dist/cropper.common.js
setStyle
function setStyle(element, styles) { var style = element.style; forEach(styles, function (value, property) { if (REGEXP_SUFFIX.test(property) && isNumber(value)) { value += 'px'; } style[property] = value; }); }
javascript
function setStyle(element, styles) { var style = element.style; forEach(styles, function (value, property) { if (REGEXP_SUFFIX.test(property) && isNumber(value)) { value += 'px'; } style[property] = value; }); }
[ "function", "setStyle", "(", "element", ",", "styles", ")", "{", "var", "style", "=", "element", ".", "style", ";", "forEach", "(", "styles", ",", "function", "(", "value", ",", "property", ")", "{", "if", "(", "REGEXP_SUFFIX", ".", "test", "(", "prope...
Apply styles to the given element. @param {Element} element - The target element. @param {Object} styles - The styles for applying.
[ "Apply", "styles", "to", "the", "given", "element", "." ]
6677332a6a375b647f58808dfc24ea09f5804041
https://github.com/fengyuanchen/cropper/blob/6677332a6a375b647f58808dfc24ea09f5804041/dist/cropper.common.js#L351-L362
train
Set style properties of an element
[ 30522, 3853, 4520, 27983, 1006, 5783, 1010, 6782, 1007, 1063, 13075, 2806, 1027, 5783, 1012, 2806, 1025, 18921, 6776, 1006, 6782, 1010, 3853, 1006, 3643, 1010, 3200, 1007, 1063, 2065, 1006, 19723, 10288, 2361, 1035, 16809, 1012, 3231, 1006,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
TryGhost/Ghost
core/server/lib/promise/sequence.js
sequence
function sequence(tasks /* Any Arguments */) { const args = Array.prototype.slice.call(arguments, 1); return Promise.reduce(tasks, function (results, task) { const response = task.apply(this, args); if (response && response.then) { return response.then(function (result) { results.push(result); return results; }); } else { return Promise.resolve().then(() => { results.push(response); return results; }); } }, []); }
javascript
function sequence(tasks /* Any Arguments */) { const args = Array.prototype.slice.call(arguments, 1); return Promise.reduce(tasks, function (results, task) { const response = task.apply(this, args); if (response && response.then) { return response.then(function (result) { results.push(result); return results; }); } else { return Promise.resolve().then(() => { results.push(response); return results; }); } }, []); }
[ "function", "sequence", "(", "tasks", "/* Any Arguments */", ")", "{", "const", "args", "=", "Array", ".", "prototype", ".", "slice", ".", "call", "(", "arguments", ",", "1", ")", ";", "return", "Promise", ".", "reduce", "(", "tasks", ",", "function", "(...
expects an array of functions returning a promise
[ "expects", "an", "array", "of", "functions", "returning", "a", "promise" ]
bb7bb55cf3e60af99ebbc56099928827b58461bc
https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/lib/promise/sequence.js#L6-L24
train
A sequence of tasks
[ 30522, 3853, 5537, 1006, 8518, 1013, 1008, 2151, 9918, 1008, 1013, 1007, 1063, 9530, 3367, 12098, 5620, 1027, 9140, 1012, 8773, 1012, 14704, 1012, 2655, 1006, 9918, 1010, 1015, 1007, 1025, 2709, 4872, 1012, 5547, 1006, 8518, 1010, 3853, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
eslint/eslint
lib/rules/no-eval.js
enterVarScope
function enterVarScope(node) { const strict = context.getScope().isStrict; funcInfo = { upper: funcInfo, node, strict, defaultThis: false, initialized: strict }; }
javascript
function enterVarScope(node) { const strict = context.getScope().isStrict; funcInfo = { upper: funcInfo, node, strict, defaultThis: false, initialized: strict }; }
[ "function", "enterVarScope", "(", "node", ")", "{", "const", "strict", "=", "context", ".", "getScope", "(", ")", ".", "isStrict", ";", "funcInfo", "=", "{", "upper", ":", "funcInfo", ",", "node", ",", "strict", ",", "defaultThis", ":", "false", ",", "...
Pushs a variable scope (Program or Function) information to the stack. This is used in order to check whether or not `this` binding is a reference to the global object. @param {ASTNode} node - A node of the scope. This is one of Program, FunctionDeclaration, FunctionExpression, and ArrowFunctionExpression. @returns {void}
[ "Pushs", "a", "variable", "scope", "(", "Program", "or", "Function", ")", "information", "to", "the", "stack", "." ]
bc0819c94aad14f7fad3cbc2338ea15658b0f272
https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-eval.js#L121-L131
train
enter a variable scope
[ 30522, 3853, 4607, 10755, 26127, 1006, 13045, 1007, 1063, 9530, 3367, 9384, 1027, 6123, 1012, 4152, 16186, 1006, 1007, 1012, 26354, 12412, 2102, 1025, 4569, 15459, 14876, 1027, 1063, 3356, 1024, 4569, 15459, 14876, 1010, 13045, 1010, 9384, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js
function (oData, sFileType) { // code extension and properties files do not need formation if ((sFileType === "js") || (sFileType === "properties")) { return oData; } // other files should be formatted to JSON try { oData = JSON.parse(oData); return JSON.stringify(oData, null, '\t'); } catch (oError){ var ErrorUtils = sap.ui.require("sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils"); ErrorUtils.displayError("Error", oError.name, oError.message); return oData; } }
javascript
function (oData, sFileType) { // code extension and properties files do not need formation if ((sFileType === "js") || (sFileType === "properties")) { return oData; } // other files should be formatted to JSON try { oData = JSON.parse(oData); return JSON.stringify(oData, null, '\t'); } catch (oError){ var ErrorUtils = sap.ui.require("sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils"); ErrorUtils.displayError("Error", oError.name, oError.message); return oData; } }
[ "function", "(", "oData", ",", "sFileType", ")", "{", "// code extension and properties files do not need formation", "if", "(", "(", "sFileType", "===", "\"js\"", ")", "||", "(", "sFileType", "===", "\"properties\"", ")", ")", "{", "return", "oData", ";", "}", ...
Pretty printer for specific file types. @param {Object} oData - data to be formatted @param {String} sFileType - file type of data @returns {Object} oData - data after formatting @public
[ "Pretty", "printer", "for", "specific", "file", "types", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js#L38-L52
train
format the data to JSON
[ 30522, 3853, 1006, 1051, 2850, 2696, 1010, 16420, 9463, 13874, 1007, 1063, 1013, 1013, 3642, 5331, 1998, 5144, 6764, 2079, 2025, 2342, 4195, 2065, 1006, 1006, 16420, 9463, 13874, 1027, 1027, 1027, 1000, 1046, 2015, 1000, 1007, 1064, 1064, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SeleniumHQ/selenium
third_party/js/mozmill/shared-modules/tabs.js
tabBrowser_getElement
function tabBrowser_getElement(spec) { var document = this._controller.window.document; var elem = null; switch(spec.type) { /** * subtype: subtype to match * value: value to match */ case "tabs": elem = new elementslib.Lookup(this._controller.window.document, TABS_TABS); break; case "tabs_allTabsButton": elem = new elementslib.Lookup(this._controller.window.document, TABS_TOOLBAR + '/id("alltabs-button")'); break; case "tabs_allTabsPopup": elem = new elementslib.Lookup(this._controller.window.document, TABS_TOOLBAR + '/id("alltabs-button")/id("alltabs-popup")'); break; case "tabs_newTabButton": elem = new elementslib.Lookup(this._controller.window.document, TABS_ARROW_SCROLLBOX + '/anon({"class":"tabs-newtab-button"})'); break; case "tabs_scrollButton": elem = new elementslib.Lookup(this._controller.window.document, TABS_ARROW_SCROLLBOX + '/anon({"anonid":"scrollbutton-' + spec.subtype + '"})'); break; case "tabs_strip": elem = new elementslib.Lookup(this._controller.window.document, TABS_STRIP); break; case "tabs_tab": switch (spec.subtype) { case "index": elem = new elementslib.Elem(this._tabs.getNode().getItemAtIndex(spec.value)); break; } break; case "tabs_tabCloseButton": var node = document.getAnonymousElementByAttribute( spec.value.getNode(), "anonid", "close-button" ); elem = new elementslib.Elem(node); break; case "tabs_tabFavicon": var node = document.getAnonymousElementByAttribute( spec.value.getNode(), "class", "tab-icon-image" ); elem = new elementslib.Elem(node); break; case "tabs_tabPanel": var panelId = spec.value.getNode().getAttribute("linkedpanel"); elem = new elementslib.Lookup(this._controller.window.document, TABS_BROWSER + '/anon({"anonid":"tabbox"})/anon({"anonid":"panelcontainer"})' + '/{"id":"' + panelId + '"}'); break; default: throw new Error(arguments.callee.name + ": Unknown element type - " + spec.type); } return elem; }
javascript
function tabBrowser_getElement(spec) { var document = this._controller.window.document; var elem = null; switch(spec.type) { /** * subtype: subtype to match * value: value to match */ case "tabs": elem = new elementslib.Lookup(this._controller.window.document, TABS_TABS); break; case "tabs_allTabsButton": elem = new elementslib.Lookup(this._controller.window.document, TABS_TOOLBAR + '/id("alltabs-button")'); break; case "tabs_allTabsPopup": elem = new elementslib.Lookup(this._controller.window.document, TABS_TOOLBAR + '/id("alltabs-button")/id("alltabs-popup")'); break; case "tabs_newTabButton": elem = new elementslib.Lookup(this._controller.window.document, TABS_ARROW_SCROLLBOX + '/anon({"class":"tabs-newtab-button"})'); break; case "tabs_scrollButton": elem = new elementslib.Lookup(this._controller.window.document, TABS_ARROW_SCROLLBOX + '/anon({"anonid":"scrollbutton-' + spec.subtype + '"})'); break; case "tabs_strip": elem = new elementslib.Lookup(this._controller.window.document, TABS_STRIP); break; case "tabs_tab": switch (spec.subtype) { case "index": elem = new elementslib.Elem(this._tabs.getNode().getItemAtIndex(spec.value)); break; } break; case "tabs_tabCloseButton": var node = document.getAnonymousElementByAttribute( spec.value.getNode(), "anonid", "close-button" ); elem = new elementslib.Elem(node); break; case "tabs_tabFavicon": var node = document.getAnonymousElementByAttribute( spec.value.getNode(), "class", "tab-icon-image" ); elem = new elementslib.Elem(node); break; case "tabs_tabPanel": var panelId = spec.value.getNode().getAttribute("linkedpanel"); elem = new elementslib.Lookup(this._controller.window.document, TABS_BROWSER + '/anon({"anonid":"tabbox"})/anon({"anonid":"panelcontainer"})' + '/{"id":"' + panelId + '"}'); break; default: throw new Error(arguments.callee.name + ": Unknown element type - " + spec.type); } return elem; }
[ "function", "tabBrowser_getElement", "(", "spec", ")", "{", "var", "document", "=", "this", ".", "_controller", ".", "window", ".", "document", ";", "var", "elem", "=", "null", ";", "switch", "(", "spec", ".", "type", ")", "{", "/**\n * subtype: subtyp...
Retrieve an UI element based on the given spec @param {object} spec Information of the UI element which should be retrieved type: General type information subtype: Specific element or property value: Value of the element or property @returns Element which has been created @type {ElemBase}
[ "Retrieve", "an", "UI", "element", "based", "on", "the", "given", "spec" ]
38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd
https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/tabs.js#L257-L325
train
Returns the element that matches the spec
[ 30522, 3853, 21628, 12618, 9333, 2121, 1035, 2131, 12260, 3672, 1006, 28699, 1007, 1063, 13075, 6254, 1027, 2023, 1012, 1035, 11486, 1012, 3332, 1012, 6254, 1025, 13075, 3449, 6633, 1027, 19701, 1025, 6942, 1006, 28699, 1012, 2828, 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...
dequelabs/axe-core
lib/checks/label/label-content-name-mismatch.js
isStringContained
function isStringContained(compare, compareWith) { const curatedCompareWith = curateString(compareWith); const curatedCompare = curateString(compare); if (!curatedCompareWith || !curatedCompare) { return false; } return curatedCompareWith.includes(curatedCompare); }
javascript
function isStringContained(compare, compareWith) { const curatedCompareWith = curateString(compareWith); const curatedCompare = curateString(compare); if (!curatedCompareWith || !curatedCompare) { return false; } return curatedCompareWith.includes(curatedCompare); }
[ "function", "isStringContained", "(", "compare", ",", "compareWith", ")", "{", "const", "curatedCompareWith", "=", "curateString", "(", "compareWith", ")", ";", "const", "curatedCompare", "=", "curateString", "(", "compare", ")", ";", "if", "(", "!", "curatedCom...
Check if a given text exists in another @param {String} compare given text to check @param {String} compareWith text against which to be compared @returns {Boolean}
[ "Check", "if", "a", "given", "text", "exists", "in", "another" ]
727323c07980e2291575f545444d389fb942906f
https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/checks/label/label-content-name-mismatch.js#L27-L34
train
Checks if a string is contained in another string
[ 30522, 3853, 26354, 18886, 3070, 8663, 28055, 1006, 12826, 1010, 12826, 24415, 1007, 1063, 9530, 3367, 17940, 9006, 19362, 7974, 8939, 1027, 27530, 3367, 4892, 1006, 12826, 24415, 1007, 1025, 9530, 3367, 17940, 9006, 19362, 2063, 1027, 27530,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
firebase/firebaseui-web
gulpfile.js
makeDefaultFile
function makeDefaultFile(fileName) { const localeForFileName = getLocaleForFileName(DEFAULT_LOCALE); const path = `${DEST_DIR}/${fileName}__${localeForFileName}.js`; if (fse.existsSync(path)) { return fse.copy(path, `${DEST_DIR}/${fileName}.js`); } }
javascript
function makeDefaultFile(fileName) { const localeForFileName = getLocaleForFileName(DEFAULT_LOCALE); const path = `${DEST_DIR}/${fileName}__${localeForFileName}.js`; if (fse.existsSync(path)) { return fse.copy(path, `${DEST_DIR}/${fileName}.js`); } }
[ "function", "makeDefaultFile", "(", "fileName", ")", "{", "const", "localeForFileName", "=", "getLocaleForFileName", "(", "DEFAULT_LOCALE", ")", ";", "const", "path", "=", "`", "${", "DEST_DIR", "}", "${", "fileName", "}", "${", "localeForFileName", "}", "`", ...
Creates the default FirebaseUI binaries for basic usage without localization. For example, it copies firebaseui__en.js to firebaseui.js. @param {string} fileName @return {!Promise} A promise that resolves on completion.
[ "Creates", "the", "default", "FirebaseUI", "binaries", "for", "basic", "usage", "without", "localization", ".", "For", "example", "it", "copies", "firebaseui__en", ".", "js", "to", "firebaseui", ".", "js", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/gulpfile.js#L238-L244
train
Creates a default file if it doesn t exist
[ 30522, 3853, 2191, 3207, 7011, 11314, 8873, 2571, 1006, 5371, 18442, 1007, 1063, 9530, 3367, 2334, 12879, 16347, 9463, 18442, 1027, 2131, 4135, 9289, 12879, 16347, 9463, 18442, 1006, 12398, 1035, 2334, 2063, 1007, 1025, 9530, 3367, 4130, 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...
aframevr/aframe
src/components/vive-controls.js
function (evt) { var button = this.mapping.buttons[evt.detail.id]; var buttonMeshes = this.buttonMeshes; var analogValue; if (!button) { return; } if (button === 'trigger') { analogValue = evt.detail.state.value; // Update trigger rotation depending on button value. if (buttonMeshes && buttonMeshes.trigger) { buttonMeshes.trigger.rotation.x = -analogValue * (Math.PI / 12); } } // Pass along changed event with button state, using button mapping for convenience. this.el.emit(button + 'changed', evt.detail.state); }
javascript
function (evt) { var button = this.mapping.buttons[evt.detail.id]; var buttonMeshes = this.buttonMeshes; var analogValue; if (!button) { return; } if (button === 'trigger') { analogValue = evt.detail.state.value; // Update trigger rotation depending on button value. if (buttonMeshes && buttonMeshes.trigger) { buttonMeshes.trigger.rotation.x = -analogValue * (Math.PI / 12); } } // Pass along changed event with button state, using button mapping for convenience. this.el.emit(button + 'changed', evt.detail.state); }
[ "function", "(", "evt", ")", "{", "var", "button", "=", "this", ".", "mapping", ".", "buttons", "[", "evt", ".", "detail", ".", "id", "]", ";", "var", "buttonMeshes", "=", "this", ".", "buttonMeshes", ";", "var", "analogValue", ";", "if", "(", "!", ...
Rotate the trigger button based on how hard the trigger is pressed.
[ "Rotate", "the", "trigger", "button", "based", "on", "how", "hard", "the", "trigger", "is", "pressed", "." ]
24acc78a7299a4cdfe3ef617f4d40ddf6275c992
https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/vive-controls.js#L146-L163
train
Trigger button change event
[ 30522, 3853, 1006, 23408, 2102, 1007, 1063, 13075, 6462, 1027, 2023, 1012, 12375, 1012, 11287, 1031, 23408, 2102, 1012, 6987, 1012, 8909, 1033, 1025, 13075, 6462, 7834, 15689, 1027, 2023, 1012, 6462, 7834, 15689, 1025, 13075, 11698, 10175, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
goldfire/howler.js
examples/player/player.js
function() { var self = this; var display = (volume.style.display === 'block') ? 'none' : 'block'; setTimeout(function() { volume.style.display = display; }, (display === 'block') ? 0 : 500); volume.className = (display === 'block') ? 'fadein' : 'fadeout'; }
javascript
function() { var self = this; var display = (volume.style.display === 'block') ? 'none' : 'block'; setTimeout(function() { volume.style.display = display; }, (display === 'block') ? 0 : 500); volume.className = (display === 'block') ? 'fadein' : 'fadeout'; }
[ "function", "(", ")", "{", "var", "self", "=", "this", ";", "var", "display", "=", "(", "volume", ".", "style", ".", "display", "===", "'block'", ")", "?", "'none'", ":", "'block'", ";", "setTimeout", "(", "function", "(", ")", "{", "volume", ".", ...
Toggle the volume display on/off.
[ "Toggle", "the", "volume", "display", "on", "/", "off", "." ]
030db918dd8ce640afd57e172418472497e8f113
https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/examples/player/player.js#L249-L257
train
Sets the display of the canton - sector volume
[ 30522, 3853, 1006, 1007, 1063, 13075, 2969, 1027, 2023, 1025, 13075, 4653, 1027, 1006, 3872, 1012, 2806, 1012, 4653, 1027, 1027, 1027, 1005, 3796, 1005, 1007, 1029, 1005, 3904, 1005, 1024, 1005, 3796, 1005, 1025, 2275, 7292, 5833, 1006, 3...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
eslint/eslint
lib/rules/comma-style.js
getFixerFunction
function getFixerFunction(styleType, previousItemToken, commaToken, currentItemToken) { const text = sourceCode.text.slice(previousItemToken.range[1], commaToken.range[0]) + sourceCode.text.slice(commaToken.range[1], currentItemToken.range[0]); const range = [previousItemToken.range[1], currentItemToken.range[0]]; return function(fixer) { return fixer.replaceTextRange(range, getReplacedText(styleType, text)); }; }
javascript
function getFixerFunction(styleType, previousItemToken, commaToken, currentItemToken) { const text = sourceCode.text.slice(previousItemToken.range[1], commaToken.range[0]) + sourceCode.text.slice(commaToken.range[1], currentItemToken.range[0]); const range = [previousItemToken.range[1], currentItemToken.range[0]]; return function(fixer) { return fixer.replaceTextRange(range, getReplacedText(styleType, text)); }; }
[ "function", "getFixerFunction", "(", "styleType", ",", "previousItemToken", ",", "commaToken", ",", "currentItemToken", ")", "{", "const", "text", "=", "sourceCode", ".", "text", ".", "slice", "(", "previousItemToken", ".", "range", "[", "1", "]", ",", "commaT...
Determines the fixer function for a given style. @param {string} styleType comma style @param {ASTNode} previousItemToken The token to check. @param {ASTNode} commaToken The token to check. @param {ASTNode} currentItemToken The token to check. @returns {Function} Fixer function @private
[ "Determines", "the", "fixer", "function", "for", "a", "given", "style", "." ]
bc0819c94aad14f7fad3cbc2338ea15658b0f272
https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/comma-style.js#L110-L119
train
Returns a function that replaces the given token with the given token.
[ 30522, 3853, 2131, 8873, 2595, 2121, 11263, 27989, 1006, 2806, 13874, 1010, 3025, 4221, 20492, 11045, 2078, 1010, 4012, 18900, 11045, 2078, 1010, 2783, 4221, 20492, 11045, 2078, 1007, 1063, 9530, 3367, 3793, 1027, 3120, 16044, 1012, 3793, 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...
electron/electron
lib/browser/chrome-extension.js
function (webContents) { const tabId = webContents.id sendToBackgroundPages('CHROME_TABS_ONCREATED') webContents.on('will-navigate', (event, url) => { sendToBackgroundPages('CHROME_WEBNAVIGATION_ONBEFORENAVIGATE', { frameId: 0, parentFrameId: -1, processId: webContents.getProcessId(), tabId: tabId, timeStamp: Date.now(), url: url }) }) webContents.on('did-navigate', (event, url) => { sendToBackgroundPages('CHROME_WEBNAVIGATION_ONCOMPLETED', { frameId: 0, parentFrameId: -1, processId: webContents.getProcessId(), tabId: tabId, timeStamp: Date.now(), url: url }) }) webContents.once('destroyed', () => { sendToBackgroundPages('CHROME_TABS_ONREMOVED', tabId) }) }
javascript
function (webContents) { const tabId = webContents.id sendToBackgroundPages('CHROME_TABS_ONCREATED') webContents.on('will-navigate', (event, url) => { sendToBackgroundPages('CHROME_WEBNAVIGATION_ONBEFORENAVIGATE', { frameId: 0, parentFrameId: -1, processId: webContents.getProcessId(), tabId: tabId, timeStamp: Date.now(), url: url }) }) webContents.on('did-navigate', (event, url) => { sendToBackgroundPages('CHROME_WEBNAVIGATION_ONCOMPLETED', { frameId: 0, parentFrameId: -1, processId: webContents.getProcessId(), tabId: tabId, timeStamp: Date.now(), url: url }) }) webContents.once('destroyed', () => { sendToBackgroundPages('CHROME_TABS_ONREMOVED', tabId) }) }
[ "function", "(", "webContents", ")", "{", "const", "tabId", "=", "webContents", ".", "id", "sendToBackgroundPages", "(", "'CHROME_TABS_ONCREATED'", ")", "webContents", ".", "on", "(", "'will-navigate'", ",", "(", "event", ",", "url", ")", "=>", "{", "sendToBac...
Dispatch web contents events to Chrome APIs
[ "Dispatch", "web", "contents", "events", "to", "Chrome", "APIs" ]
6e29611788277729647acf465f10db1ea6f15788
https://github.com/electron/electron/blob/6e29611788277729647acf465f10db1ea6f15788/lib/browser/chrome-extension.js#L123-L153
train
This function is called by the main window when the window is created
[ 30522, 3853, 1006, 4773, 8663, 6528, 3215, 1007, 1063, 9530, 3367, 21628, 3593, 1027, 4773, 8663, 6528, 3215, 1012, 8909, 4604, 3406, 5963, 16365, 13704, 2015, 1006, 1005, 18546, 1035, 21628, 2015, 1035, 2006, 16748, 4383, 1005, 1007, 4773,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
askmike/gekko
plugins/postgresql/util.js
function () { return useSingleDatabase() ? config.postgresql.database : config.watch.exchange.toLowerCase().replace(/\-/g,''); }
javascript
function () { return useSingleDatabase() ? config.postgresql.database : config.watch.exchange.toLowerCase().replace(/\-/g,''); }
[ "function", "(", ")", "{", "return", "useSingleDatabase", "(", ")", "?", "config", ".", "postgresql", ".", "database", ":", "config", ".", "watch", ".", "exchange", ".", "toLowerCase", "(", ")", ".", "replace", "(", "/", "\\-", "/", "g", ",", "''", "...
returns DB name (depends on single db setup)
[ "returns", "DB", "name", "(", "depends", "on", "single", "db", "setup", ")" ]
0ce9ddd577fa8a22812c02331a494086758dfadf
https://github.com/askmike/gekko/blob/0ce9ddd577fa8a22812c02331a494086758dfadf/plugins/postgresql/util.js#L38-L42
train
Returns the database name for the database
[ 30522, 3853, 1006, 1007, 1063, 2709, 3594, 2075, 3709, 6790, 15058, 1006, 1007, 1029, 9530, 8873, 2290, 1012, 2695, 17603, 2015, 4160, 2140, 1012, 7809, 1024, 9530, 8873, 2290, 1012, 3422, 1012, 3863, 1012, 2000, 27663, 18992, 3366, 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...
mochajs/mocha
lib/errors.js
createInvalidInterfaceError
function createInvalidInterfaceError(message, ui) { var err = new Error(message); err.code = 'ERR_MOCHA_INVALID_INTERFACE'; err.interface = ui; return err; }
javascript
function createInvalidInterfaceError(message, ui) { var err = new Error(message); err.code = 'ERR_MOCHA_INVALID_INTERFACE'; err.interface = ui; return err; }
[ "function", "createInvalidInterfaceError", "(", "message", ",", "ui", ")", "{", "var", "err", "=", "new", "Error", "(", "message", ")", ";", "err", ".", "code", "=", "'ERR_MOCHA_INVALID_INTERFACE'", ";", "err", ".", "interface", "=", "ui", ";", "return", "...
Creates an error object to be thrown when the interface specified in the options was not found. @public @param {string} message - Error message to be displayed. @param {string} ui - User-specified interface value. @returns {Error} instance detailing the error condition
[ "Creates", "an", "error", "object", "to", "be", "thrown", "when", "the", "interface", "specified", "in", "the", "options", "was", "not", "found", "." ]
9b00fedb610241e33f7592c40164e42a38a793cf
https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/errors.js#L47-L52
train
Create an error object for an invalid interface
[ 30522, 3853, 3443, 2378, 10175, 28173, 10111, 12881, 10732, 2121, 29165, 1006, 4471, 1010, 21318, 1007, 1063, 13075, 9413, 2099, 1027, 2047, 7561, 1006, 4471, 1007, 1025, 9413, 2099, 1012, 3642, 1027, 1005, 9413, 2099, 1035, 9587, 7507, 103...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
storybooks/storybook
lib/core/src/client/preview/start.js
showException
function showException(exception) { addons.getChannel().emit(Events.STORY_THREW_EXCEPTION, exception); showErrorDisplay(exception); // Log the stack to the console. So, user could check the source code. logger.error(exception.stack); }
javascript
function showException(exception) { addons.getChannel().emit(Events.STORY_THREW_EXCEPTION, exception); showErrorDisplay(exception); // Log the stack to the console. So, user could check the source code. logger.error(exception.stack); }
[ "function", "showException", "(", "exception", ")", "{", "addons", ".", "getChannel", "(", ")", ".", "emit", "(", "Events", ".", "STORY_THREW_EXCEPTION", ",", "exception", ")", ";", "showErrorDisplay", "(", "exception", ")", ";", "// Log the stack to the console. ...
showException is used if we fail to render the story and it is uncaught by the app layer
[ "showException", "is", "used", "if", "we", "fail", "to", "render", "the", "story", "and", "it", "is", "uncaught", "by", "the", "app", "layer" ]
9bff9271b7e163fb12b9ee0cf697c56f9d727b7b
https://github.com/storybooks/storybook/blob/9bff9271b7e163fb12b9ee0cf697c56f9d727b7b/lib/core/src/client/preview/start.js#L50-L56
train
Show an exception
[ 30522, 3853, 2265, 10288, 24422, 1006, 6453, 1007, 1063, 5587, 5644, 1012, 2131, 26058, 1006, 1007, 1012, 12495, 2102, 1006, 2824, 1012, 2466, 1035, 4711, 1035, 6453, 1010, 6453, 1007, 1025, 6457, 29165, 10521, 13068, 1006, 6453, 1007, 1025...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jquery/jquery
build/release/dist.js
clone
function clone() { Release.chdir( Release.dir.base ); Release.dir.dist = Release.dir.base + "/dist"; console.log( "Using distribution repo: ", distRemote ); Release.exec( "git clone " + distRemote + " " + Release.dir.dist, "Error cloning repo." ); // Distribution always works on master Release.chdir( Release.dir.dist ); Release.exec( "git checkout master", "Error checking out branch." ); console.log(); }
javascript
function clone() { Release.chdir( Release.dir.base ); Release.dir.dist = Release.dir.base + "/dist"; console.log( "Using distribution repo: ", distRemote ); Release.exec( "git clone " + distRemote + " " + Release.dir.dist, "Error cloning repo." ); // Distribution always works on master Release.chdir( Release.dir.dist ); Release.exec( "git checkout master", "Error checking out branch." ); console.log(); }
[ "function", "clone", "(", ")", "{", "Release", ".", "chdir", "(", "Release", ".", "dir", ".", "base", ")", ";", "Release", ".", "dir", ".", "dist", "=", "Release", ".", "dir", ".", "base", "+", "\"/dist\"", ";", "console", ".", "log", "(", "\"Using...
Clone the distribution repo
[ "Clone", "the", "distribution", "repo" ]
ccbd6b93424cbdbf86f07a86c2e55cbab497d7a3
https://github.com/jquery/jquery/blob/ccbd6b93424cbdbf86f07a86c2e55cbab497d7a3/build/release/dist.js#L23-L35
train
Clones the distribution repo
[ 30522, 3853, 17598, 1006, 1007, 1063, 2713, 1012, 10381, 4305, 2099, 1006, 2713, 1012, 16101, 1012, 2918, 1007, 1025, 2713, 1012, 16101, 1012, 4487, 3367, 1027, 2713, 1012, 16101, 1012, 2918, 1009, 1000, 1013, 4487, 3367, 1000, 1025, 10122,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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
addQuickOpenPlugin
function addQuickOpenPlugin(pluginDef) { var quickOpenProvider = new QuickOpenPlugin( pluginDef.name, pluginDef.languageIds, pluginDef.done, pluginDef.search, pluginDef.match, pluginDef.itemFocus, pluginDef.itemSelect, pluginDef.resultsFormatter, pluginDef.matcherOptions, pluginDef.label ), providerLanguageIds = pluginDef.languageIds.length ? pluginDef.languageIds : ["all"], providerPriority = pluginDef.priority || 0; _registerQuickOpenProvider(quickOpenProvider, providerLanguageIds, providerPriority); }
javascript
function addQuickOpenPlugin(pluginDef) { var quickOpenProvider = new QuickOpenPlugin( pluginDef.name, pluginDef.languageIds, pluginDef.done, pluginDef.search, pluginDef.match, pluginDef.itemFocus, pluginDef.itemSelect, pluginDef.resultsFormatter, pluginDef.matcherOptions, pluginDef.label ), providerLanguageIds = pluginDef.languageIds.length ? pluginDef.languageIds : ["all"], providerPriority = pluginDef.priority || 0; _registerQuickOpenProvider(quickOpenProvider, providerLanguageIds, providerPriority); }
[ "function", "addQuickOpenPlugin", "(", "pluginDef", ")", "{", "var", "quickOpenProvider", "=", "new", "QuickOpenPlugin", "(", "pluginDef", ".", "name", ",", "pluginDef", ".", "languageIds", ",", "pluginDef", ".", "done", ",", "pluginDef", ".", "search", ",", "...
Creates and registers a new QuickOpenPlugin @param { name: string, languageIds: !Array.<string>, done: ?function(), search: function(string, !StringMatch.StringMatcher):(!Array.<SearchResult|string>|$.Promise), match: function(string):boolean, itemFocus: ?function(?SearchResult|string, string, boolean), itemSelect: function(?SearchResult|string, string), resultsFormatter: ?function(SearchResult|string, string):string, matcherOptions: ?Object, label: ?string } pluginDef Parameter Documentation: name - plug-in name, **must be unique** languageIds - language Ids array. Example: ["javascript", "css", "html"]. To allow any language, pass []. Required. done - called when quick open is complete. Plug-in should clear its internal state. Optional. search - takes a query string and a StringMatcher (the use of which is optional but can speed up your searches) and returns an array of strings or result objects that match the query; or a Promise that resolves to such an array. Required. match - takes a query string and returns true if this plug-in wants to provide results for this query. Required. itemFocus - performs an action when a result has been highlighted (via arrow keys, or by becoming top of the list). Passed the highlighted search result item (as returned by search()), the current query string, and a flag that is true if the item was highlighted explicitly (arrow keys), not implicitly (at top of list after last search()). Optional. itemSelect - performs an action when a result is chosen. Passed the highlighted search result item (as returned by search()), and the current query string. Required. resultsFormatter - takes a query string and an item string and returns a <LI> item to insert into the displayed search results. Optional. matcherOptions - options to pass along to the StringMatcher (see StringMatch.StringMatcher for available options). Optional. label - if provided, the label to show before the query field. Optional. If itemFocus() makes changes to the current document or cursor/scroll position and then the user cancels Quick Open (via Esc), those changes are automatically reverted.
[ "Creates", "and", "registers", "a", "new", "QuickOpenPlugin" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/QuickOpen.js#L176-L193
train
Adds a QuickOpenPlugin to the cache
[ 30522, 3853, 5587, 15549, 19665, 11837, 24759, 15916, 2378, 1006, 13354, 22254, 12879, 1007, 1063, 13075, 4248, 26915, 21572, 17258, 2121, 1027, 2047, 4248, 26915, 24759, 15916, 2378, 1006, 13354, 22254, 12879, 1012, 2171, 1010, 13354, 22254, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SeleniumHQ/selenium
javascript/node/optparse.js
formatOption
function formatOption(name, helpMsg) { var result = []; var options = IDENTATION + '--' + name; if (options.length > MAX_HELP_POSITION) { result.push(options); result.push('\n'); result.push(wrapStr(helpMsg, TOTAL_WIDTH, repeatStr(' ', HELP_TEXT_POSITION)).join('\n')); } else { var spaceCount = HELP_TEXT_POSITION - options.length; options += repeatStr(' ', spaceCount) + helpMsg; result.push(options.substring(0, TOTAL_WIDTH)); options = options.substring(TOTAL_WIDTH); if (options) { result.push('\n'); result.push(wrapStr(options, TOTAL_WIDTH, repeatStr(' ', HELP_TEXT_POSITION)).join('\n')); } } return result.join(''); }
javascript
function formatOption(name, helpMsg) { var result = []; var options = IDENTATION + '--' + name; if (options.length > MAX_HELP_POSITION) { result.push(options); result.push('\n'); result.push(wrapStr(helpMsg, TOTAL_WIDTH, repeatStr(' ', HELP_TEXT_POSITION)).join('\n')); } else { var spaceCount = HELP_TEXT_POSITION - options.length; options += repeatStr(' ', spaceCount) + helpMsg; result.push(options.substring(0, TOTAL_WIDTH)); options = options.substring(TOTAL_WIDTH); if (options) { result.push('\n'); result.push(wrapStr(options, TOTAL_WIDTH, repeatStr(' ', HELP_TEXT_POSITION)).join('\n')); } } return result.join(''); }
[ "function", "formatOption", "(", "name", ",", "helpMsg", ")", "{", "var", "result", "=", "[", "]", ";", "var", "options", "=", "IDENTATION", "+", "'--'", "+", "name", ";", "if", "(", "options", ".", "length", ">", "MAX_HELP_POSITION", ")", "{", "result...
Formats the help message for a single option. Will place the option string and help text on the same line whenever possible. @param {string} name The name of the option. @param {string} helpMsg The option's help message. @return {string} The formatted option.
[ "Formats", "the", "help", "message", "for", "a", "single", "option", ".", "Will", "place", "the", "option", "string", "and", "help", "text", "on", "the", "same", "line", "whenever", "possible", "." ]
38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd
https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/node/optparse.js#L150-L172
train
Format an option
[ 30522, 3853, 4289, 7361, 3508, 1006, 2171, 1010, 2393, 5244, 2290, 1007, 1063, 13075, 2765, 1027, 1031, 1033, 1025, 13075, 7047, 1027, 8909, 19304, 1009, 1005, 1011, 1011, 1005, 1009, 2171, 1025, 2065, 1006, 7047, 1012, 3091, 1028, 4098, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js
getValueListQualifier
function getValueListQualifier(sTerm) { var sQualifier = getQualifier(sTerm, sValueListMapping); return sQualifier !== undefined ? sQualifier : getQualifier(sTerm, sValueList); }
javascript
function getValueListQualifier(sTerm) { var sQualifier = getQualifier(sTerm, sValueListMapping); return sQualifier !== undefined ? sQualifier : getQualifier(sTerm, sValueList); }
[ "function", "getValueListQualifier", "(", "sTerm", ")", "{", "var", "sQualifier", "=", "getQualifier", "(", "sTerm", ",", "sValueListMapping", ")", ";", "return", "sQualifier", "!==", "undefined", "?", "sQualifier", ":", "getQualifier", "(", "sTerm", ",", "sValu...
Checks that the term is a ValueList or a ValueListMapping and determines the qualifier. @param {string} sTerm The term @returns {string} The qualifier or undefined, if the term is not as expected
[ "Checks", "that", "the", "term", "is", "a", "ValueList", "or", "a", "ValueListMapping", "and", "determines", "the", "qualifier", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js#L239-L243
train
Get the value list qualifier from the value list mapping
[ 30522, 3853, 2131, 10175, 16284, 2923, 26426, 18095, 1006, 26261, 10867, 1007, 1063, 13075, 5490, 8787, 18095, 1027, 2131, 26426, 18095, 1006, 26261, 10867, 1010, 17917, 2389, 16284, 2923, 2863, 14853, 1007, 1025, 2709, 5490, 8787, 18095, 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...
SAP/openui5
src/sap.ui.fl/src/sap/ui/fl/changeHandler/BaseRename.js
function(oChange, oControl, mPropertyBag) { var oModifier = mPropertyBag.modifier; var sPropertyName = mRenameSettings.propertyName; var vOldValue = oChange.getRevertData(); if (vOldValue || vOldValue === "") { oModifier.setPropertyBindingOrProperty(oControl, sPropertyName, vOldValue); oChange.resetRevertData(); return true; } else { Utils.log.error("Change doesn't contain sufficient information to be reverted. Most Likely the Change didn't go through applyChange."); } }
javascript
function(oChange, oControl, mPropertyBag) { var oModifier = mPropertyBag.modifier; var sPropertyName = mRenameSettings.propertyName; var vOldValue = oChange.getRevertData(); if (vOldValue || vOldValue === "") { oModifier.setPropertyBindingOrProperty(oControl, sPropertyName, vOldValue); oChange.resetRevertData(); return true; } else { Utils.log.error("Change doesn't contain sufficient information to be reverted. Most Likely the Change didn't go through applyChange."); } }
[ "function", "(", "oChange", ",", "oControl", ",", "mPropertyBag", ")", "{", "var", "oModifier", "=", "mPropertyBag", ".", "modifier", ";", "var", "sPropertyName", "=", "mRenameSettings", ".", "propertyName", ";", "var", "vOldValue", "=", "oChange", ".", "getRe...
Reverts a Rename Change @param {sap.ui.fl.Change} oChange change wrapper object with instructions to be applied on the control map @param {sap.ui.core.Control} oControl Control that matches the change selector for applying the change @param {object} mPropertyBag property bag @param {object} mPropertyBag.modifier modifier for the controls @returns {boolean} true if successful @public
[ "Reverts", "a", "Rename", "Change" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/changeHandler/BaseRename.js#L73-L85
train
This function is called when a change is reverted.
[ 30522, 3853, 1006, 28166, 22043, 1010, 1051, 8663, 13181, 2140, 1010, 6131, 18981, 15010, 16078, 1007, 1063, 13075, 18168, 7716, 18095, 1027, 6131, 18981, 15010, 16078, 1012, 16913, 18095, 1025, 13075, 11867, 18981, 15010, 18442, 1027, 2720, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/core/routing/sync/Target.js
function (oParentInfo, bLog) { var oOptions = this._oOptions, oControl = oParentInfo && oParentInfo.oTargetControl, bHasTargetControl = (oControl || oOptions.controlId), bIsValid = true, sLogMessage = ""; if (!bHasTargetControl) { sLogMessage = "The target " + oOptions._name + " has no controlId set and no parent so the target cannot be displayed."; bIsValid = false; } if (!oOptions.controlAggregation) { sLogMessage = "The target " + oOptions._name + " has a control id or a parent but no 'controlAggregation' was set, so the target could not be displayed."; bIsValid = false; } if (!oOptions.viewName) { sLogMessage = "The target " + oOptions._name + " no viewName defined."; bIsValid = false; } if (bLog && sLogMessage) { Log.error(sLogMessage, this); } return bIsValid; }
javascript
function (oParentInfo, bLog) { var oOptions = this._oOptions, oControl = oParentInfo && oParentInfo.oTargetControl, bHasTargetControl = (oControl || oOptions.controlId), bIsValid = true, sLogMessage = ""; if (!bHasTargetControl) { sLogMessage = "The target " + oOptions._name + " has no controlId set and no parent so the target cannot be displayed."; bIsValid = false; } if (!oOptions.controlAggregation) { sLogMessage = "The target " + oOptions._name + " has a control id or a parent but no 'controlAggregation' was set, so the target could not be displayed."; bIsValid = false; } if (!oOptions.viewName) { sLogMessage = "The target " + oOptions._name + " no viewName defined."; bIsValid = false; } if (bLog && sLogMessage) { Log.error(sLogMessage, this); } return bIsValid; }
[ "function", "(", "oParentInfo", ",", "bLog", ")", "{", "var", "oOptions", "=", "this", ".", "_oOptions", ",", "oControl", "=", "oParentInfo", "&&", "oParentInfo", ".", "oTargetControl", ",", "bHasTargetControl", "=", "(", "oControl", "||", "oOptions", ".", "...
Validates the target options, will also be called from the route but route will not log errors @param oParentInfo @param {boolean} bLog @returns {boolean} @private
[ "Validates", "the", "target", "options", "will", "also", "be", "called", "from", "the", "route", "but", "route", "will", "not", "log", "errors" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/routing/sync/Target.js#L137-L164
train
Checks if the target is valid and if so logs an error.
[ 30522, 3853, 1006, 6728, 12069, 16778, 2078, 14876, 1010, 9927, 1007, 1063, 13075, 1051, 7361, 9285, 1027, 2023, 1012, 1035, 1051, 7361, 9285, 1010, 1051, 8663, 13181, 2140, 1027, 6728, 12069, 16778, 2078, 14876, 1004, 1004, 6728, 12069, 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...
jaredpalmer/razzle
packages/razzle/scripts/start.js
compile
function compile(config) { let compiler; try { compiler = webpack(config); } catch (e) { printErrors('Failed to compile.', [e]); process.exit(1); } return compiler; }
javascript
function compile(config) { let compiler; try { compiler = webpack(config); } catch (e) { printErrors('Failed to compile.', [e]); process.exit(1); } return compiler; }
[ "function", "compile", "(", "config", ")", "{", "let", "compiler", ";", "try", "{", "compiler", "=", "webpack", "(", "config", ")", ";", "}", "catch", "(", "e", ")", "{", "printErrors", "(", "'Failed to compile.'", ",", "[", "e", "]", ")", ";", "proc...
Webpack compile in a try-catch
[ "Webpack", "compile", "in", "a", "try", "-", "catch" ]
6f12cb8a84a1ef1b8491c36958a8797f97407312
https://github.com/jaredpalmer/razzle/blob/6f12cb8a84a1ef1b8491c36958a8797f97407312/packages/razzle/scripts/start.js#L90-L99
train
Compile the webpack module.
[ 30522, 3853, 4012, 22090, 1006, 9530, 8873, 2290, 1007, 1063, 2292, 21624, 1025, 3046, 1063, 21624, 1027, 4773, 23947, 1006, 9530, 8873, 2290, 1007, 1025, 1065, 4608, 1006, 1041, 1007, 1063, 15041, 29165, 2015, 1006, 1005, 3478, 2000, 4012,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/base/ManagedObject.js
isInclusiveDescendantOf
function isInclusiveDescendantOf(a, b) { while ( a && a !== b ) { a = a.oParent; } return !!a; }
javascript
function isInclusiveDescendantOf(a, b) { while ( a && a !== b ) { a = a.oParent; } return !!a; }
[ "function", "isInclusiveDescendantOf", "(", "a", ",", "b", ")", "{", "while", "(", "a", "&&", "a", "!==", "b", ")", "{", "a", "=", "a", ".", "oParent", ";", "}", "return", "!", "!", "a", ";", "}" ]
Checks whether object <code>a</code> is an inclusive descendant of object <code>b</code>. @param {sap.ui.base.ManagedObject} a Object that should be checked for being a descendant @param {sap.ui.base.ManagedObject} b Object that should be checked for having a descendant @returns {boolean} Whether <code>a</code> is a descendant of (or the same as) <code>b</code> @private
[ "Checks", "whether", "object", "<code", ">", "a<", "/", "code", ">", "is", "an", "inclusive", "descendant", "of", "object", "<code", ">", "b<", "/", "code", ">", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/ManagedObject.js#L2520-L2525
train
Determines whether a is a descendant of b.
[ 30522, 3853, 2003, 2378, 23633, 6155, 23865, 21634, 2546, 1006, 1037, 1010, 1038, 1007, 1063, 2096, 1006, 1037, 1004, 1004, 1037, 999, 1027, 1027, 1038, 1007, 1063, 1037, 1027, 1037, 1012, 6728, 12069, 3372, 1025, 1065, 2709, 999, 999, 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...
infinitered/ignite
src/cli/enforce-global.js
enforce
function enforce(opts = {}) { // opts to pass in var optional = opts.optional || false var range = opts.range var whichExec = opts.which var packageName = opts.packageName || opts.which var versionCommand = opts.versionCommand var installMessage = opts.installMessage var versionMatcher = opts.versionMatcher || defaultVersionMatcher /** * Prints a friendly message that they don't meet the requirement. * * @param {string} installedVersion - current version if installed. */ function printNotMetMessage(installedVersion) { console.log('Ignite CLI requires ' + packageName + ' ' + range + ' to be installed.') if (installedVersion) { console.log('') console.log('You currently have ' + installedVersion + ' installed.') } console.log('') console.log(installMessage) } /** * Gets the version from the global dependency. * * @return {string} The version number or null. */ function getVersion() { // parse the version number try { // find the executable var resolvedPath = which.sync(whichExec) // grab the raw output var result = shell.exec(`"${resolvedPath}" ${versionCommand}`, { silent: true }) var rawOut = ramda.trim(result.stdout || '') var rawErr = ramda.trim(result.stderr || '') // java -version does this... grr // assign the "right" one to raw var raw = rawOut if (ramda.isEmpty(raw)) { raw = rawErr } if (ramda.isEmpty(raw)) { raw = null } // and run it by the version matcher return versionMatcher(raw) } catch (err) { return null } } // are we installed? var isInstalled = Boolean(shell.which(whichExec)) if (!isInstalled) { if (optional) { return true } else { printNotMetMessage() return false } } // which version is installed? try { var installedVersion = getVersion() var isMet = semver.satisfies(installedVersion, range) // dependency has minimum met, we're good. if (isMet) return true } catch (err) { // can't parse? just catch and we'll fallback to an error. } // o snap, time to upgrade printNotMetMessage(installedVersion) return false }
javascript
function enforce(opts = {}) { // opts to pass in var optional = opts.optional || false var range = opts.range var whichExec = opts.which var packageName = opts.packageName || opts.which var versionCommand = opts.versionCommand var installMessage = opts.installMessage var versionMatcher = opts.versionMatcher || defaultVersionMatcher /** * Prints a friendly message that they don't meet the requirement. * * @param {string} installedVersion - current version if installed. */ function printNotMetMessage(installedVersion) { console.log('Ignite CLI requires ' + packageName + ' ' + range + ' to be installed.') if (installedVersion) { console.log('') console.log('You currently have ' + installedVersion + ' installed.') } console.log('') console.log(installMessage) } /** * Gets the version from the global dependency. * * @return {string} The version number or null. */ function getVersion() { // parse the version number try { // find the executable var resolvedPath = which.sync(whichExec) // grab the raw output var result = shell.exec(`"${resolvedPath}" ${versionCommand}`, { silent: true }) var rawOut = ramda.trim(result.stdout || '') var rawErr = ramda.trim(result.stderr || '') // java -version does this... grr // assign the "right" one to raw var raw = rawOut if (ramda.isEmpty(raw)) { raw = rawErr } if (ramda.isEmpty(raw)) { raw = null } // and run it by the version matcher return versionMatcher(raw) } catch (err) { return null } } // are we installed? var isInstalled = Boolean(shell.which(whichExec)) if (!isInstalled) { if (optional) { return true } else { printNotMetMessage() return false } } // which version is installed? try { var installedVersion = getVersion() var isMet = semver.satisfies(installedVersion, range) // dependency has minimum met, we're good. if (isMet) return true } catch (err) { // can't parse? just catch and we'll fallback to an error. } // o snap, time to upgrade printNotMetMessage(installedVersion) return false }
[ "function", "enforce", "(", "opts", "=", "{", "}", ")", "{", "// opts to pass in", "var", "optional", "=", "opts", ".", "optional", "||", "false", "var", "range", "=", "opts", ".", "range", "var", "whichExec", "=", "opts", ".", "which", "var", "packageNa...
Verifies the dependency which is installed is compatible with ignite. @param {any} opts The options to enforce. @param {boolean} opts.optional Is this an optional dependency? @param {string} opts.range The semver range to test against. @param {string} opts.which The command to run `which` on. @param {string} opts.packageName The npm package we're checking for. @param {string} opts.versionCommand The command to run which returns text containing the version number. @param {string} opts.installMessage What to print should we fail. @param {function} opts.versionMatcher A way to override the method to discover the version number. @return {boolean} `true` if we meet the requirements; otherwise `false`.
[ "Verifies", "the", "dependency", "which", "is", "installed", "is", "compatible", "with", "ignite", "." ]
dca91da22f9ad9bab1eb9f43565689d563bd111d
https://github.com/infinitered/ignite/blob/dca91da22f9ad9bab1eb9f43565689d563bd111d/src/cli/enforce-global.js#L47-L130
train
Enforce the current version of the Ignite CLI
[ 30522, 3853, 16306, 1006, 23569, 2015, 1027, 1063, 1065, 1007, 1063, 1013, 1013, 23569, 2015, 2000, 3413, 1999, 13075, 11887, 1027, 23569, 2015, 1012, 11887, 1064, 1064, 6270, 13075, 2846, 1027, 23569, 2015, 1012, 2846, 13075, 2029, 10288, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/incubator-echarts
src/chart/sankey/sankeyLayout.js
initializeNodeDepth
function initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) { var minKy = Infinity; zrUtil.each(nodesByBreadth, function (nodes) { var n = nodes.length; var sum = 0; zrUtil.each(nodes, function (node) { sum += node.getLayout().value; }); var ky = orient === 'vertical' ? (width - (n - 1) * nodeGap) / sum : (height - (n - 1) * nodeGap) / sum; if (ky < minKy) { minKy = ky; } }); zrUtil.each(nodesByBreadth, function (nodes) { zrUtil.each(nodes, function (node, i) { var nodeDy = node.getLayout().value * minKy; if (orient === 'vertical') { node.setLayout({x: i}, true); node.setLayout({dx: nodeDy}, true); } else { node.setLayout({y: i}, true); node.setLayout({dy: nodeDy}, true); } }); }); zrUtil.each(edges, function (edge) { var edgeDy = +edge.getValue() * minKy; edge.setLayout({dy: edgeDy}, true); }); }
javascript
function initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) { var minKy = Infinity; zrUtil.each(nodesByBreadth, function (nodes) { var n = nodes.length; var sum = 0; zrUtil.each(nodes, function (node) { sum += node.getLayout().value; }); var ky = orient === 'vertical' ? (width - (n - 1) * nodeGap) / sum : (height - (n - 1) * nodeGap) / sum; if (ky < minKy) { minKy = ky; } }); zrUtil.each(nodesByBreadth, function (nodes) { zrUtil.each(nodes, function (node, i) { var nodeDy = node.getLayout().value * minKy; if (orient === 'vertical') { node.setLayout({x: i}, true); node.setLayout({dx: nodeDy}, true); } else { node.setLayout({y: i}, true); node.setLayout({dy: nodeDy}, true); } }); }); zrUtil.each(edges, function (edge) { var edgeDy = +edge.getValue() * minKy; edge.setLayout({dy: edgeDy}, true); }); }
[ "function", "initializeNodeDepth", "(", "nodesByBreadth", ",", "edges", ",", "height", ",", "width", ",", "nodeGap", ",", "orient", ")", "{", "var", "minKy", "=", "Infinity", ";", "zrUtil", ".", "each", "(", "nodesByBreadth", ",", "function", "(", "nodes", ...
Compute the original y-position for each node @param {module:echarts/data/Graph~Node} nodes node of sankey view @param {Array.<Array.<module:echarts/data/Graph~Node>>} nodesByBreadth group by the array of all sankey nodes based on the nodes x-position. @param {module:echarts/data/Graph~Edge} edges edge of sankey view @param {number} height the whole height of the area to draw the view @param {number} nodeGap the vertical distance between two nodes
[ "Compute", "the", "original", "y", "-", "position", "for", "each", "node" ]
4d0ea095dc3929cb6de40c45748826e7999c7aa8
https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/sankey/sankeyLayout.js#L302-L337
train
Initialize node depth
[ 30522, 3853, 3988, 4697, 3630, 5732, 23606, 2232, 1006, 14164, 3762, 27035, 2705, 1010, 7926, 1010, 4578, 1010, 9381, 1010, 13045, 3654, 2361, 1010, 16865, 1007, 1063, 13075, 8117, 4801, 1027, 15579, 1025, 1062, 22134, 4014, 1012, 2169, 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...
firebase/firebaseui-web
demo/public/app.js
function() { document.getElementById('sign-in-with-redirect').addEventListener( 'click', signInWithRedirect); document.getElementById('sign-in-with-popup').addEventListener( 'click', signInWithPopup); document.getElementById('sign-out').addEventListener('click', function() { firebase.auth().signOut(); }); document.getElementById('delete-account').addEventListener( 'click', function() { deleteAccount(); }); document.getElementById('recaptcha-normal').addEventListener( 'change', handleConfigChange); document.getElementById('recaptcha-invisible').addEventListener( 'change', handleConfigChange); // Check the selected reCAPTCHA mode. document.querySelector( 'input[name="recaptcha"][value="' + getRecaptchaMode() + '"]') .checked = true; document.getElementById('email-signInMethod-password').addEventListener( 'change', handleConfigChange); document.getElementById('email-signInMethod-emailLink').addEventListener( 'change', handleConfigChange); // Check the selected email signInMethod mode. document.querySelector( 'input[name="emailSignInMethod"][value="' + getEmailSignInMethod() + '"]') .checked = true; }
javascript
function() { document.getElementById('sign-in-with-redirect').addEventListener( 'click', signInWithRedirect); document.getElementById('sign-in-with-popup').addEventListener( 'click', signInWithPopup); document.getElementById('sign-out').addEventListener('click', function() { firebase.auth().signOut(); }); document.getElementById('delete-account').addEventListener( 'click', function() { deleteAccount(); }); document.getElementById('recaptcha-normal').addEventListener( 'change', handleConfigChange); document.getElementById('recaptcha-invisible').addEventListener( 'change', handleConfigChange); // Check the selected reCAPTCHA mode. document.querySelector( 'input[name="recaptcha"][value="' + getRecaptchaMode() + '"]') .checked = true; document.getElementById('email-signInMethod-password').addEventListener( 'change', handleConfigChange); document.getElementById('email-signInMethod-emailLink').addEventListener( 'change', handleConfigChange); // Check the selected email signInMethod mode. document.querySelector( 'input[name="emailSignInMethod"][value="' + getEmailSignInMethod() + '"]') .checked = true; }
[ "function", "(", ")", "{", "document", ".", "getElementById", "(", "'sign-in-with-redirect'", ")", ".", "addEventListener", "(", "'click'", ",", "signInWithRedirect", ")", ";", "document", ".", "getElementById", "(", "'sign-in-with-popup'", ")", ".", "addEventListen...
Initializes the app.
[ "Initializes", "the", "app", "." ]
c10aa51e38aeb38dc63baa22b48cd6690c2be087
https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/demo/public/app.js#L208-L238
train
Adds event listeners to the window
[ 30522, 3853, 1006, 1007, 1063, 6254, 1012, 2131, 12260, 3672, 3762, 3593, 1006, 1005, 3696, 1011, 1999, 1011, 2007, 1011, 2417, 7442, 6593, 1005, 1007, 1012, 5587, 18697, 3372, 9863, 24454, 1006, 1005, 11562, 1005, 1010, 3696, 2378, 24415, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/NavigationAndHistory/NavigationProvider.js
_navigateBack
function _navigateBack() { if (!jumpForwardStack.length) { if (activePosNotSynced) { currentEditPos = new NavigationFrame(EditorManager.getCurrentFullEditor(), {ranges: EditorManager.getCurrentFullEditor()._codeMirror.listSelections()}); jumpForwardStack.push(currentEditPos); } } var navFrame = jumpBackwardStack.pop(); // Check if the poped frame is the current active frame or doesn't have any valid marker information // if true, jump again if (navFrame && navFrame === currentEditPos) { jumpForwardStack.push(navFrame); _validateNavigationCmds(); CommandManager.execute(NAVIGATION_JUMP_BACK); return; } if (navFrame) { // We will check for the file existence now, if it doesn't exist we will jump back again // but discard the popped frame as invalid. _validateFrame(navFrame).done(function () { jumpForwardStack.push(navFrame); navFrame.goTo(); currentEditPos = navFrame; }).fail(function () { CommandManager.execute(NAVIGATION_JUMP_BACK); }).always(function () { _validateNavigationCmds(); }); } }
javascript
function _navigateBack() { if (!jumpForwardStack.length) { if (activePosNotSynced) { currentEditPos = new NavigationFrame(EditorManager.getCurrentFullEditor(), {ranges: EditorManager.getCurrentFullEditor()._codeMirror.listSelections()}); jumpForwardStack.push(currentEditPos); } } var navFrame = jumpBackwardStack.pop(); // Check if the poped frame is the current active frame or doesn't have any valid marker information // if true, jump again if (navFrame && navFrame === currentEditPos) { jumpForwardStack.push(navFrame); _validateNavigationCmds(); CommandManager.execute(NAVIGATION_JUMP_BACK); return; } if (navFrame) { // We will check for the file existence now, if it doesn't exist we will jump back again // but discard the popped frame as invalid. _validateFrame(navFrame).done(function () { jumpForwardStack.push(navFrame); navFrame.goTo(); currentEditPos = navFrame; }).fail(function () { CommandManager.execute(NAVIGATION_JUMP_BACK); }).always(function () { _validateNavigationCmds(); }); } }
[ "function", "_navigateBack", "(", ")", "{", "if", "(", "!", "jumpForwardStack", ".", "length", ")", "{", "if", "(", "activePosNotSynced", ")", "{", "currentEditPos", "=", "new", "NavigationFrame", "(", "EditorManager", ".", "getCurrentFullEditor", "(", ")", ",...
Command handler to navigate backward
[ "Command", "handler", "to", "navigate", "backward" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/NavigationProvider.js#L339-L371
train
Navigates back to the previous frame
[ 30522, 3853, 1035, 22149, 5963, 1006, 1007, 1063, 2065, 1006, 999, 5376, 29278, 7652, 9153, 3600, 1012, 3091, 1007, 1063, 2065, 1006, 3161, 6873, 2015, 17048, 6508, 5897, 2094, 1007, 1063, 2783, 2098, 4183, 6873, 2015, 1027, 2047, 9163, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/incubator-echarts
src/chart/sunburst/SunburstPiece.js
SunburstPiece
function SunburstPiece(node, seriesModel, ecModel) { graphic.Group.call(this); var sector = new graphic.Sector({ z2: DEFAULT_SECTOR_Z }); sector.seriesIndex = seriesModel.seriesIndex; var text = new graphic.Text({ z2: DEFAULT_TEXT_Z, silent: node.getModel('label').get('silent') }); this.add(sector); this.add(text); this.updateData(true, node, 'normal', seriesModel, ecModel); // Hover to change label and labelLine function onEmphasis() { text.ignore = text.hoverIgnore; } function onNormal() { text.ignore = text.normalIgnore; } this.on('emphasis', onEmphasis) .on('normal', onNormal) .on('mouseover', onEmphasis) .on('mouseout', onNormal); }
javascript
function SunburstPiece(node, seriesModel, ecModel) { graphic.Group.call(this); var sector = new graphic.Sector({ z2: DEFAULT_SECTOR_Z }); sector.seriesIndex = seriesModel.seriesIndex; var text = new graphic.Text({ z2: DEFAULT_TEXT_Z, silent: node.getModel('label').get('silent') }); this.add(sector); this.add(text); this.updateData(true, node, 'normal', seriesModel, ecModel); // Hover to change label and labelLine function onEmphasis() { text.ignore = text.hoverIgnore; } function onNormal() { text.ignore = text.normalIgnore; } this.on('emphasis', onEmphasis) .on('normal', onNormal) .on('mouseover', onEmphasis) .on('mouseout', onNormal); }
[ "function", "SunburstPiece", "(", "node", ",", "seriesModel", ",", "ecModel", ")", "{", "graphic", ".", "Group", ".", "call", "(", "this", ")", ";", "var", "sector", "=", "new", "graphic", ".", "Sector", "(", "{", "z2", ":", "DEFAULT_SECTOR_Z", "}", ")...
Sunburstce of Sunburst including Sector, Label, LabelLine @constructor @extends {module:zrender/graphic/Group}
[ "Sunburstce", "of", "Sunburst", "including", "Sector", "Label", "LabelLine" ]
4d0ea095dc3929cb6de40c45748826e7999c7aa8
https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/sunburst/SunburstPiece.js#L38-L67
train
Sunburst piece
[ 30522, 3853, 3103, 8569, 12096, 11198, 1006, 13045, 1010, 2186, 5302, 9247, 1010, 14925, 5302, 9247, 1007, 1063, 8425, 1012, 2177, 1012, 2655, 1006, 2023, 1007, 1025, 13075, 4753, 1027, 2047, 8425, 1012, 4753, 1006, 1063, 1062, 2475, 1024, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/History.js
function (sFormat) { var oFormattedHistory, aHistory = this.getHistory(); switch (sFormat) { case library.HistoryFormats.Abap: oFormattedHistory = AbapHistoryFormatter.format(aHistory); break; default : oFormattedHistory = StringHistoryFormatter.format(aHistory); } return oFormattedHistory; }
javascript
function (sFormat) { var oFormattedHistory, aHistory = this.getHistory(); switch (sFormat) { case library.HistoryFormats.Abap: oFormattedHistory = AbapHistoryFormatter.format(aHistory); break; default : oFormattedHistory = StringHistoryFormatter.format(aHistory); } return oFormattedHistory; }
[ "function", "(", "sFormat", ")", "{", "var", "oFormattedHistory", ",", "aHistory", "=", "this", ".", "getHistory", "(", ")", ";", "switch", "(", "sFormat", ")", "{", "case", "library", ".", "HistoryFormats", ".", "Abap", ":", "oFormattedHistory", "=", "Aba...
Returns the history into formatted output depending on the passed format. @public @method @param {string} sFormat The format into which the history object will be converted. Possible values are listed in sap.ui.support.HistoryFormats. @name sap.ui.support.History.getFormattedHistory @returns {*} All analysis history objects in the correct format.
[ "Returns", "the", "history", "into", "formatted", "output", "depending", "on", "the", "passed", "format", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.support/src/sap/ui/support/supportRules/History.js#L220-L233
train
Returns the formatted history in the given format.
[ 30522, 3853, 1006, 16420, 2953, 18900, 1007, 1063, 13075, 1997, 2953, 18900, 3064, 24158, 7062, 1010, 6289, 20483, 2854, 1027, 2023, 1012, 2131, 24158, 7062, 1006, 1007, 1025, 6942, 1006, 16420, 2953, 18900, 1007, 1063, 2553, 3075, 1012, 23...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
GitbookIO/gitbook
lib/output/ebook/getPDFTemplate.js
getPDFTemplate
function getPDFTemplate(output, type) { var filePath = 'pdf_' + type + '.html'; var outputRoot = output.getRoot(); var engine = WebsiteGenerator.createTemplateEngine(output, filePath); // Generate context var context = JSONUtils.encodeOutput(output); context.page = { num: '_PAGENUM_', title: '_SECTION_' }; // Render the theme return Templating.renderFile(engine, 'ebook/' + filePath, context) // Inline css and assets .then(function(tplOut) { return Promise.nfcall(juice.juiceResources, tplOut.getContent(), { webResources: { relativeTo: outputRoot } }); }); }
javascript
function getPDFTemplate(output, type) { var filePath = 'pdf_' + type + '.html'; var outputRoot = output.getRoot(); var engine = WebsiteGenerator.createTemplateEngine(output, filePath); // Generate context var context = JSONUtils.encodeOutput(output); context.page = { num: '_PAGENUM_', title: '_SECTION_' }; // Render the theme return Templating.renderFile(engine, 'ebook/' + filePath, context) // Inline css and assets .then(function(tplOut) { return Promise.nfcall(juice.juiceResources, tplOut.getContent(), { webResources: { relativeTo: outputRoot } }); }); }
[ "function", "getPDFTemplate", "(", "output", ",", "type", ")", "{", "var", "filePath", "=", "'pdf_'", "+", "type", "+", "'.html'", ";", "var", "outputRoot", "=", "output", ".", "getRoot", "(", ")", ";", "var", "engine", "=", "WebsiteGenerator", ".", "cre...
Generate PDF header/footer templates @param {Output} output @param {String} type @return {String}
[ "Generate", "PDF", "header", "/", "footer", "templates" ]
6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4
https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/output/ebook/getPDFTemplate.js#L16-L39
train
Get the PDF template
[ 30522, 3853, 2131, 17299, 6199, 6633, 15725, 1006, 6434, 1010, 2828, 1007, 1063, 13075, 5371, 15069, 1027, 1005, 11135, 1035, 1005, 1009, 2828, 1009, 1005, 1012, 16129, 1005, 1025, 13075, 6434, 3217, 4140, 1027, 6434, 1012, 2131, 3217, 4140...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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
contrib/mhchem/mhchem.js
function (input, stateMachine) { if (!input) { return []; } if (stateMachine === undefined) { stateMachine = 'ce'; } var state = '0'; // // String buffers for parsing: // // buffer.a == amount // buffer.o == element // buffer.b == left-side superscript // buffer.p == left-side subscript // buffer.q == right-side subscript // buffer.d == right-side superscript // // buffer.r == arrow // buffer.rdt == arrow, script above, type // buffer.rd == arrow, script above, content // buffer.rqt == arrow, script below, type // buffer.rq == arrow, script below, content // // buffer.text_ // buffer.rm // etc. // // buffer.parenthesisLevel == int, starting at 0 // buffer.sb == bool, space before // buffer.beginsWithBond == bool // // These letters are also used as state names. // // Other states: // 0 == begin of main part (arrow/operator unlikely) // 1 == next entity // 2 == next entity (arrow/operator unlikely) // 3 == next atom // c == macro // /** @type {Buffer} */ var buffer = {}; buffer['parenthesisLevel'] = 0; input = input.replace(/\n/g, " "); input = input.replace(/[\u2212\u2013\u2014\u2010]/g, "-"); input = input.replace(/[\u2026]/g, "..."); // // Looks through mhchemParser.transitions, to execute a matching action // (recursive) // var lastInput; var watchdog = 10; /** @type {ParserOutput[]} */ var output = []; while (true) { if (lastInput !== input) { watchdog = 10; lastInput = input; } else { watchdog--; } // // Find actions in transition table // var machine = mhchemParser.stateMachines[stateMachine]; var t = machine.transitions[state] || machine.transitions['*']; iterateTransitions: for (var i=0; i<t.length; i++) { var matches = mhchemParser.patterns.match_(t[i].pattern, input); if (matches) { // // Execute actions // var task = t[i].task; for (var iA=0; iA<task.action_.length; iA++) { var o; // // Find and execute action // if (machine.actions[task.action_[iA].type_]) { o = machine.actions[task.action_[iA].type_](buffer, matches.match_, task.action_[iA].option); } else if (mhchemParser.actions[task.action_[iA].type_]) { o = mhchemParser.actions[task.action_[iA].type_](buffer, matches.match_, task.action_[iA].option); } else { throw ["MhchemBugA", "mhchem bug A. Please report. (" + task.action_[iA].type_ + ")"]; // Trying to use non-existing action } // // Add output // mhchemParser.concatArray(output, o); } // // Set next state, // Shorten input, // Continue with next character // (= apply only one transition per position) // state = task.nextState || state; if (input.length > 0) { if (!task.revisit) { input = matches.remainder; } if (!task.toContinue) { break iterateTransitions; } } else { return output; } } } // // Prevent infinite loop // if (watchdog <= 0) { throw ["MhchemBugU", "mhchem bug U. Please report."]; // Unexpected character } } }
javascript
function (input, stateMachine) { if (!input) { return []; } if (stateMachine === undefined) { stateMachine = 'ce'; } var state = '0'; // // String buffers for parsing: // // buffer.a == amount // buffer.o == element // buffer.b == left-side superscript // buffer.p == left-side subscript // buffer.q == right-side subscript // buffer.d == right-side superscript // // buffer.r == arrow // buffer.rdt == arrow, script above, type // buffer.rd == arrow, script above, content // buffer.rqt == arrow, script below, type // buffer.rq == arrow, script below, content // // buffer.text_ // buffer.rm // etc. // // buffer.parenthesisLevel == int, starting at 0 // buffer.sb == bool, space before // buffer.beginsWithBond == bool // // These letters are also used as state names. // // Other states: // 0 == begin of main part (arrow/operator unlikely) // 1 == next entity // 2 == next entity (arrow/operator unlikely) // 3 == next atom // c == macro // /** @type {Buffer} */ var buffer = {}; buffer['parenthesisLevel'] = 0; input = input.replace(/\n/g, " "); input = input.replace(/[\u2212\u2013\u2014\u2010]/g, "-"); input = input.replace(/[\u2026]/g, "..."); // // Looks through mhchemParser.transitions, to execute a matching action // (recursive) // var lastInput; var watchdog = 10; /** @type {ParserOutput[]} */ var output = []; while (true) { if (lastInput !== input) { watchdog = 10; lastInput = input; } else { watchdog--; } // // Find actions in transition table // var machine = mhchemParser.stateMachines[stateMachine]; var t = machine.transitions[state] || machine.transitions['*']; iterateTransitions: for (var i=0; i<t.length; i++) { var matches = mhchemParser.patterns.match_(t[i].pattern, input); if (matches) { // // Execute actions // var task = t[i].task; for (var iA=0; iA<task.action_.length; iA++) { var o; // // Find and execute action // if (machine.actions[task.action_[iA].type_]) { o = machine.actions[task.action_[iA].type_](buffer, matches.match_, task.action_[iA].option); } else if (mhchemParser.actions[task.action_[iA].type_]) { o = mhchemParser.actions[task.action_[iA].type_](buffer, matches.match_, task.action_[iA].option); } else { throw ["MhchemBugA", "mhchem bug A. Please report. (" + task.action_[iA].type_ + ")"]; // Trying to use non-existing action } // // Add output // mhchemParser.concatArray(output, o); } // // Set next state, // Shorten input, // Continue with next character // (= apply only one transition per position) // state = task.nextState || state; if (input.length > 0) { if (!task.revisit) { input = matches.remainder; } if (!task.toContinue) { break iterateTransitions; } } else { return output; } } } // // Prevent infinite loop // if (watchdog <= 0) { throw ["MhchemBugU", "mhchem bug U. Please report."]; // Unexpected character } } }
[ "function", "(", "input", ",", "stateMachine", ")", "{", "if", "(", "!", "input", ")", "{", "return", "[", "]", ";", "}", "if", "(", "stateMachine", "===", "undefined", ")", "{", "stateMachine", "=", "'ce'", ";", "}", "var", "state", "=", "'0'", ";...
Parses mchem \ce syntax Call like go("H2O");
[ "Parses", "mchem", "\\", "ce", "syntax", "Call", "like", "go", "(", "H2O", ")", ";" ]
17bfb247b88070267f3e5c7b21fe4a360fdf49d9
https://github.com/KaTeX/KaTeX/blob/17bfb247b88070267f3e5c7b21fe4a360fdf49d9/contrib/mhchem/mhchem.js#L105-L222
train
Parses a string into an array of parser output
[ 30522, 3853, 1006, 7953, 1010, 2110, 22911, 14014, 1007, 1063, 2065, 1006, 999, 7953, 1007, 1063, 2709, 1031, 1033, 1025, 1065, 2065, 1006, 2110, 22911, 14014, 1027, 1027, 1027, 6151, 28344, 1007, 1063, 2110, 22911, 14014, 1027, 1005, 8292,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/thirdparty/less.js
function () { var value; if (! $re(/^\(opacity=/i)) { return; } value = $re(/^\d+/) || this.entities.variable(); if (value) { expectChar(')'); return new(tree.Alpha)(value); } }
javascript
function () { var value; if (! $re(/^\(opacity=/i)) { return; } value = $re(/^\d+/) || this.entities.variable(); if (value) { expectChar(')'); return new(tree.Alpha)(value); } }
[ "function", "(", ")", "{", "var", "value", ";", "if", "(", "!", "$re", "(", "/", "^\\(opacity=", "/", "i", ")", ")", "{", "return", ";", "}", "value", "=", "$re", "(", "/", "^\\d+", "/", ")", "||", "this", ".", "entities", ".", "variable", "(",...
IE's alpha function alpha(opacity=88)
[ "IE", "s", "alpha", "function", "alpha", "(", "opacity", "=", "88", ")" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/less.js#L1333-L1342
train
expectChar ( ) ;
[ 30522, 3853, 1006, 1007, 1063, 13075, 3643, 1025, 2065, 1006, 999, 1002, 2128, 1006, 1013, 1034, 1032, 1006, 6728, 6305, 3012, 1027, 1013, 1045, 1007, 1007, 1063, 2709, 1025, 1065, 3643, 1027, 1002, 2128, 1006, 1013, 1034, 1032, 1040, 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...
googleapis/google-api-nodejs-client
samples/defaultauth.js
main
async function main() { // The `getClient` method will choose a service based authentication model const auth = await google.auth.getClient({ // Scopes can be specified either as an array or as a single, space-delimited string. scopes: ['https://www.googleapis.com/auth/compute'], }); // Obtain the current project Id const project = await google.auth.getProjectId(); // Get the list of available compute zones for your project const res = await compute.zones.list({project, auth}); console.log(res.data); }
javascript
async function main() { // The `getClient` method will choose a service based authentication model const auth = await google.auth.getClient({ // Scopes can be specified either as an array or as a single, space-delimited string. scopes: ['https://www.googleapis.com/auth/compute'], }); // Obtain the current project Id const project = await google.auth.getProjectId(); // Get the list of available compute zones for your project const res = await compute.zones.list({project, auth}); console.log(res.data); }
[ "async", "function", "main", "(", ")", "{", "// The `getClient` method will choose a service based authentication model", "const", "auth", "=", "await", "google", ".", "auth", ".", "getClient", "(", "{", "// Scopes can be specified either as an array or as a single, space-delimit...
The google.auth.getClient method creates the appropriate type of credential client for you, depending upon whether the client is running in Google App Engine, Google Compute Engine, a Managed VM, or on a local developer machine. This allows you to write one set of auth code that will work in all cases. It most situations, it is advisable to use the getClient method rather than creating your own JWT or Compute client directly. Note: In order to run on a local developer machine, it is necessary to download a private key file to your machine, and to set a local environment variable pointing to the location of the file. Create a service account using the Google Developers Console using the section APIs & Auth. Select "Generate new JSON key" and download the resulting file. Once this is done, set the GOOGLE_APPLICATION_CREDENTIALS environment variable to point to the location of the .json file. See also: https://developers.google.com/accounts/docs/application-default-credentials Get the appropriate type of credential client, depending upon the runtime environment.
[ "The", "google", ".", "auth", ".", "getClient", "method", "creates", "the", "appropriate", "type", "of", "credential", "client", "for", "you", "depending", "upon", "whether", "the", "client", "is", "running", "in", "Google", "App", "Engine", "Google", "Compute...
e6e632a29d0b246d058e3067de3a5c3827e2b54e
https://github.com/googleapis/google-api-nodejs-client/blob/e6e632a29d0b246d058e3067de3a5c3827e2b54e/samples/defaultauth.js#L37-L50
train
Main entry point for the cluster
[ 30522, 2004, 6038, 2278, 3853, 2364, 1006, 1007, 1063, 1013, 1013, 1996, 1036, 2131, 20464, 11638, 1036, 4118, 2097, 5454, 1037, 2326, 2241, 27280, 2944, 9530, 3367, 8740, 2705, 1027, 26751, 8224, 1012, 8740, 2705, 1012, 2131, 20464, 11638,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
mdn/browser-compat-data
scripts/render.js
writeSupportInfo
function writeSupportInfo(supportData, browserId, compatNotes) { let output = ''; // browsers are optional in the data, display them as "?" in our table if (!supportData) { output += getVersionString(null); // we have support data, lets go } else { output += getVersionString(supportData.version_added); if (supportData.version_removed) { // We don't know when if (typeof(supportData.version_removed) === 'boolean' && supportData.version_removed) { output += '&nbsp;—?' } else { // We know when output += '&nbsp;— ' + supportData.version_removed; } } // Add prefix if (supportData.prefix) { output += `<span title="prefix" class="inlineIndicator prefixBox prefixBoxInline"> <a title="The name of this feature is prefixed with '${supportData.prefix}' as this browser considers it experimental" href="/en-US/docs/Web/Guide/Prefixes">${supportData.prefix} </a></span>`; } // Add note anchors // There are three types of notes (notes, flag notes, and alternative names). // Collect them and order them, before adding them to the cell let noteAnchors = []; // Generate notes, if any if (supportData.notes) { if (Array.isArray(supportData.notes)) { for (let note of supportData.notes) { let noteIndex = compatNotes.indexOf(note); noteAnchors.push(`<sup><a href="#compatNote_${noteIndex+1}">${noteIndex+1}</a></sup>`); } } else { let noteIndex = compatNotes.indexOf(supportData.notes); noteAnchors.push(`<sup><a href="#compatNote_${noteIndex+1}">${noteIndex+1}</a></sup>`); } } // there is a flag and it needs a note, too if (supportData.flag) { let flagNote = writeFlagsNote(supportData, browserId); let noteIndex = compatNotes.indexOf(flagNote); noteAnchors.push(`<sup><a href="#compatNote_${noteIndex+1}">${noteIndex+1}</a></sup>`); } // add a link to the alternative name note, if there is one if (supportData.alternative_name) { let altNameNote = writeAlternativeNameNote(supportData.alternative_name); let noteIndex = compatNotes.indexOf(altNameNote); noteAnchors.push(`<sup><a href="#compatNote_${noteIndex+1}">${noteIndex+1}</a></sup>`); } noteAnchors = noteAnchors.sort(); if ((supportData.partial_support || noteAnchors.length > 0) && aggregateMode) { output += ' *'; } else { output += noteAnchors.join(' '); } } return output; }
javascript
function writeSupportInfo(supportData, browserId, compatNotes) { let output = ''; // browsers are optional in the data, display them as "?" in our table if (!supportData) { output += getVersionString(null); // we have support data, lets go } else { output += getVersionString(supportData.version_added); if (supportData.version_removed) { // We don't know when if (typeof(supportData.version_removed) === 'boolean' && supportData.version_removed) { output += '&nbsp;—?' } else { // We know when output += '&nbsp;— ' + supportData.version_removed; } } // Add prefix if (supportData.prefix) { output += `<span title="prefix" class="inlineIndicator prefixBox prefixBoxInline"> <a title="The name of this feature is prefixed with '${supportData.prefix}' as this browser considers it experimental" href="/en-US/docs/Web/Guide/Prefixes">${supportData.prefix} </a></span>`; } // Add note anchors // There are three types of notes (notes, flag notes, and alternative names). // Collect them and order them, before adding them to the cell let noteAnchors = []; // Generate notes, if any if (supportData.notes) { if (Array.isArray(supportData.notes)) { for (let note of supportData.notes) { let noteIndex = compatNotes.indexOf(note); noteAnchors.push(`<sup><a href="#compatNote_${noteIndex+1}">${noteIndex+1}</a></sup>`); } } else { let noteIndex = compatNotes.indexOf(supportData.notes); noteAnchors.push(`<sup><a href="#compatNote_${noteIndex+1}">${noteIndex+1}</a></sup>`); } } // there is a flag and it needs a note, too if (supportData.flag) { let flagNote = writeFlagsNote(supportData, browserId); let noteIndex = compatNotes.indexOf(flagNote); noteAnchors.push(`<sup><a href="#compatNote_${noteIndex+1}">${noteIndex+1}</a></sup>`); } // add a link to the alternative name note, if there is one if (supportData.alternative_name) { let altNameNote = writeAlternativeNameNote(supportData.alternative_name); let noteIndex = compatNotes.indexOf(altNameNote); noteAnchors.push(`<sup><a href="#compatNote_${noteIndex+1}">${noteIndex+1}</a></sup>`); } noteAnchors = noteAnchors.sort(); if ((supportData.partial_support || noteAnchors.length > 0) && aggregateMode) { output += ' *'; } else { output += noteAnchors.join(' '); } } return output; }
[ "function", "writeSupportInfo", "(", "supportData", ",", "browserId", ",", "compatNotes", ")", "{", "let", "output", "=", "''", ";", "// browsers are optional in the data, display them as \"?\" in our table", "if", "(", "!", "supportData", ")", "{", "output", "+=", "g...
/* Main function responsible for the contents of a support cell in the table. `supportData` is a support_statement `browserId` is a compat_block browser ID `compatNotes` is collected Compatibility notes
[ "/", "*", "Main", "function", "responsible", "for", "the", "contents", "of", "a", "support", "cell", "in", "the", "table", "." ]
6ca59b232e8fe080f441c7cb625d2bfd1a6fbe2b
https://github.com/mdn/browser-compat-data/blob/6ca59b232e8fe080f441c7cb625d2bfd1a6fbe2b/scripts/render.js#L206-L273
train
Write support info to the table
[ 30522, 3853, 7009, 6279, 6442, 2378, 14876, 1006, 2490, 2850, 2696, 1010, 16602, 3593, 1010, 4012, 4502, 2102, 20564, 1007, 1063, 2292, 6434, 1027, 1005, 1005, 1025, 1013, 1013, 16602, 2015, 2024, 11887, 1999, 1996, 2951, 1010, 4653, 2068, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
angular/material
src/components/gridList/grid-list.js
layoutDelegate
function layoutDelegate(tilesInvalidated) { var tiles = getTileElements(); var props = { tileSpans: getTileSpans(tiles), colCount: getColumnCount(), rowMode: getRowMode(), rowHeight: getRowHeight(), gutter: getGutter() }; if (!tilesInvalidated && angular.equals(props, lastLayoutProps)) { return; } var performance = $mdGridLayout(props.colCount, props.tileSpans, tiles) .map(function(tilePositions, rowCount) { return { grid: { element: element, style: getGridStyle(props.colCount, rowCount, props.gutter, props.rowMode, props.rowHeight) }, tiles: tilePositions.map(function(ps, i) { return { element: angular.element(tiles[i]), style: getTileStyle(ps.position, ps.spans, props.colCount, rowCount, props.gutter, props.rowMode, props.rowHeight) }; }) }; }) .reflow() .performance(); // Report layout scope.mdOnLayout({ $event: { performance: performance } }); lastLayoutProps = props; }
javascript
function layoutDelegate(tilesInvalidated) { var tiles = getTileElements(); var props = { tileSpans: getTileSpans(tiles), colCount: getColumnCount(), rowMode: getRowMode(), rowHeight: getRowHeight(), gutter: getGutter() }; if (!tilesInvalidated && angular.equals(props, lastLayoutProps)) { return; } var performance = $mdGridLayout(props.colCount, props.tileSpans, tiles) .map(function(tilePositions, rowCount) { return { grid: { element: element, style: getGridStyle(props.colCount, rowCount, props.gutter, props.rowMode, props.rowHeight) }, tiles: tilePositions.map(function(ps, i) { return { element: angular.element(tiles[i]), style: getTileStyle(ps.position, ps.spans, props.colCount, rowCount, props.gutter, props.rowMode, props.rowHeight) }; }) }; }) .reflow() .performance(); // Report layout scope.mdOnLayout({ $event: { performance: performance } }); lastLayoutProps = props; }
[ "function", "layoutDelegate", "(", "tilesInvalidated", ")", "{", "var", "tiles", "=", "getTileElements", "(", ")", ";", "var", "props", "=", "{", "tileSpans", ":", "getTileSpans", "(", "tiles", ")", ",", "colCount", ":", "getColumnCount", "(", ")", ",", "r...
Invokes the layout engine, and uses its results to lay out our tile elements. @param {boolean} tilesInvalidated Whether tiles have been added/removed/moved since the last layout. This is to avoid situations where tiles are replaced with properties identical to their removed counterparts.
[ "Invokes", "the", "layout", "engine", "and", "uses", "its", "results", "to", "lay", "out", "our", "tile", "elements", "." ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/gridList/grid-list.js#L167-L211
train
This is the layout function that is called when the user has requested a new layout.
[ 30522, 3853, 9621, 9247, 29107, 2618, 1006, 13262, 2378, 10175, 8524, 3064, 1007, 1063, 13075, 13262, 1027, 2131, 15286, 12260, 8163, 1006, 1007, 1025, 13075, 24387, 1027, 1063, 13262, 9739, 2015, 1024, 2131, 15286, 13102, 6962, 1006, 13262, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
laurent22/joplin
Clipper/joplin-webclipper/content_scripts/Readability.js
function () { // Avoid parsing too large documents, as per configuration option if (this._maxElemsToParse > 0) { var numTags = this._doc.getElementsByTagName("*").length; if (numTags > this._maxElemsToParse) { throw new Error("Aborting parsing document; " + numTags + " elements found"); } } if (typeof this._doc.documentElement.firstElementChild === "undefined") { this._getNextNode = this._getNextNodeNoElementProperties; } // Remove script tags from the document. this._removeScripts(this._doc); this._prepDocument(); var metadata = this._getArticleMetadata(); this._articleTitle = metadata.title; var articleContent = this._grabArticle(); if (!articleContent) return null; this.log("Grabbed: " + articleContent.innerHTML); this._postProcessContent(articleContent); // If we haven't found an excerpt in the article's metadata, use the article's // first paragraph as the excerpt. This is used for displaying a preview of // the article's content. if (!metadata.excerpt) { var paragraphs = articleContent.getElementsByTagName("p"); if (paragraphs.length > 0) { metadata.excerpt = paragraphs[0].textContent.trim(); } } var textContent = articleContent.textContent; return { title: this._articleTitle, byline: metadata.byline || this._articleByline, dir: this._articleDir, content: articleContent.innerHTML, textContent: textContent, length: textContent.length, excerpt: metadata.excerpt, }; }
javascript
function () { // Avoid parsing too large documents, as per configuration option if (this._maxElemsToParse > 0) { var numTags = this._doc.getElementsByTagName("*").length; if (numTags > this._maxElemsToParse) { throw new Error("Aborting parsing document; " + numTags + " elements found"); } } if (typeof this._doc.documentElement.firstElementChild === "undefined") { this._getNextNode = this._getNextNodeNoElementProperties; } // Remove script tags from the document. this._removeScripts(this._doc); this._prepDocument(); var metadata = this._getArticleMetadata(); this._articleTitle = metadata.title; var articleContent = this._grabArticle(); if (!articleContent) return null; this.log("Grabbed: " + articleContent.innerHTML); this._postProcessContent(articleContent); // If we haven't found an excerpt in the article's metadata, use the article's // first paragraph as the excerpt. This is used for displaying a preview of // the article's content. if (!metadata.excerpt) { var paragraphs = articleContent.getElementsByTagName("p"); if (paragraphs.length > 0) { metadata.excerpt = paragraphs[0].textContent.trim(); } } var textContent = articleContent.textContent; return { title: this._articleTitle, byline: metadata.byline || this._articleByline, dir: this._articleDir, content: articleContent.innerHTML, textContent: textContent, length: textContent.length, excerpt: metadata.excerpt, }; }
[ "function", "(", ")", "{", "// Avoid parsing too large documents, as per configuration option", "if", "(", "this", ".", "_maxElemsToParse", ">", "0", ")", "{", "var", "numTags", "=", "this", ".", "_doc", ".", "getElementsByTagName", "(", "\"*\"", ")", ".", "length...
Runs readability. Workflow: 1. Prep the document by removing script tags, css, etc. 2. Build readability's DOM tree. 3. Grab the article content from the current dom tree. 4. Replace the current DOM tree with the new one. 5. Read peacefully. @return void
[ "Runs", "readability", "." ]
beb428b246cecba4630a3ca57b472f43c0933a43
https://github.com/laurent22/joplin/blob/beb428b246cecba4630a3ca57b472f43c0933a43/Clipper/joplin-webclipper/content_scripts/Readability.js#L1768-L1816
train
Returns the content of the article
[ 30522, 3853, 1006, 1007, 1063, 1013, 1013, 4468, 11968, 7741, 2205, 2312, 5491, 1010, 2004, 2566, 9563, 5724, 2065, 1006, 2023, 1012, 1035, 4098, 12260, 5244, 14399, 11650, 2063, 1028, 1014, 1007, 1063, 13075, 16371, 20492, 26454, 1027, 202...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
dimsemenov/PhotoSwipe
src/js/gestures.js
function(p1, p2, pCenter) { pCenter.x = (p1.x + p2.x) * 0.5; pCenter.y = (p1.y + p2.y) * 0.5; }
javascript
function(p1, p2, pCenter) { pCenter.x = (p1.x + p2.x) * 0.5; pCenter.y = (p1.y + p2.y) * 0.5; }
[ "function", "(", "p1", ",", "p2", ",", "pCenter", ")", "{", "pCenter", ".", "x", "=", "(", "p1", ".", "x", "+", "p2", ".", "x", ")", "*", "0.5", ";", "pCenter", ".", "y", "=", "(", "p1", ".", "y", "+", "p2", ".", "y", ")", "*", "0.5", "...
amount of pixels to drag to determine direction of swipe
[ "amount", "of", "pixels", "to", "drag", "to", "determine", "direction", "of", "swipe" ]
80607e12542a1a54ecefa837649e862b35dffd25
https://github.com/dimsemenov/PhotoSwipe/blob/80607e12542a1a54ecefa837649e862b35dffd25/src/js/gestures.js#L112-L115
train
Calculate the center of the line
[ 30522, 3853, 1006, 1052, 2487, 1010, 1052, 2475, 1010, 7473, 29110, 1007, 1063, 7473, 29110, 1012, 1060, 1027, 1006, 1052, 2487, 1012, 1060, 1009, 1052, 2475, 1012, 1060, 1007, 1008, 1014, 1012, 1019, 1025, 7473, 29110, 1012, 1061, 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...
aframevr/aframe
src/core/component.js
function (newData, clobber, silent) { var componentDefined; var data; var defaultValue; var key; var mixinData; var nextData = this.nextData; var schema = this.schema; var i; var mixinEls = this.el.mixinEls; var previousData; // Whether component has a defined value. For arrays, treat empty as not defined. componentDefined = newData && newData.constructor === Array ? newData.length : newData !== undefined && newData !== null; if (this.isObjectBased) { utils.objectPool.clearObject(nextData); } // 1. Gather default values (lowest precendence). if (this.isSingleProperty) { if (this.isObjectBased) { // If object-based single-prop, then copy over the data to our pooled object. data = copyData(nextData, schema.default); } else { // If is plain single-prop, copy by value the default. data = isObjectOrArray(schema.default) ? utils.clone(schema.default) : schema.default; } } else { // Preserve previously set properties if clobber not enabled. previousData = !clobber && this.attrValue; // Clone default value if object so components don't share object data = previousData instanceof Object ? copyData(nextData, previousData) : nextData; // Apply defaults. for (key in schema) { defaultValue = schema[key].default; if (data[key] !== undefined) { continue; } // Clone default value if object so components don't share object data[key] = isObjectOrArray(defaultValue) ? utils.clone(defaultValue) : defaultValue; } } // 2. Gather mixin values. for (i = 0; i < mixinEls.length; i++) { mixinData = mixinEls[i].getAttribute(this.attrName); if (!mixinData) { continue; } data = extendProperties(data, mixinData, this.isObjectBased); } // 3. Gather attribute values (highest precendence). if (componentDefined) { if (this.isSingleProperty) { // If object-based, copy the value to not modify the original. if (isObject(newData)) { copyData(this.parsingAttrValue, newData); return parseProperty(this.parsingAttrValue, schema); } return parseProperty(newData, schema); } data = extendProperties(data, newData, this.isObjectBased); } else { // Parse and coerce using the schema. if (this.isSingleProperty) { return parseProperty(data, schema); } } return parseProperties(data, schema, undefined, this.name, silent); }
javascript
function (newData, clobber, silent) { var componentDefined; var data; var defaultValue; var key; var mixinData; var nextData = this.nextData; var schema = this.schema; var i; var mixinEls = this.el.mixinEls; var previousData; // Whether component has a defined value. For arrays, treat empty as not defined. componentDefined = newData && newData.constructor === Array ? newData.length : newData !== undefined && newData !== null; if (this.isObjectBased) { utils.objectPool.clearObject(nextData); } // 1. Gather default values (lowest precendence). if (this.isSingleProperty) { if (this.isObjectBased) { // If object-based single-prop, then copy over the data to our pooled object. data = copyData(nextData, schema.default); } else { // If is plain single-prop, copy by value the default. data = isObjectOrArray(schema.default) ? utils.clone(schema.default) : schema.default; } } else { // Preserve previously set properties if clobber not enabled. previousData = !clobber && this.attrValue; // Clone default value if object so components don't share object data = previousData instanceof Object ? copyData(nextData, previousData) : nextData; // Apply defaults. for (key in schema) { defaultValue = schema[key].default; if (data[key] !== undefined) { continue; } // Clone default value if object so components don't share object data[key] = isObjectOrArray(defaultValue) ? utils.clone(defaultValue) : defaultValue; } } // 2. Gather mixin values. for (i = 0; i < mixinEls.length; i++) { mixinData = mixinEls[i].getAttribute(this.attrName); if (!mixinData) { continue; } data = extendProperties(data, mixinData, this.isObjectBased); } // 3. Gather attribute values (highest precendence). if (componentDefined) { if (this.isSingleProperty) { // If object-based, copy the value to not modify the original. if (isObject(newData)) { copyData(this.parsingAttrValue, newData); return parseProperty(this.parsingAttrValue, schema); } return parseProperty(newData, schema); } data = extendProperties(data, newData, this.isObjectBased); } else { // Parse and coerce using the schema. if (this.isSingleProperty) { return parseProperty(data, schema); } } return parseProperties(data, schema, undefined, this.name, silent); }
[ "function", "(", "newData", ",", "clobber", ",", "silent", ")", "{", "var", "componentDefined", ";", "var", "data", ";", "var", "defaultValue", ";", "var", "key", ";", "var", "mixinData", ";", "var", "nextData", "=", "this", ".", "nextData", ";", "var", ...
Build component data from the current state of the entity.data. Precedence: 1. Defaults data 2. Mixin data. 3. Attribute data. Finally coerce the data to the types of the defaults. @param {object} newData - Element new data. @param {boolean} clobber - The previous data is completely replaced by the new one. @param {boolean} silent - Suppress warning messages. @return {object} The component data
[ "Build", "component", "data", "from", "the", "current", "state", "of", "the", "entity", ".", "data", "." ]
24acc78a7299a4cdfe3ef617f4d40ddf6275c992
https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/core/component.js#L479-L553
train
Returns the data to be modified.
[ 30522, 3853, 1006, 2047, 2850, 2696, 1010, 18856, 16429, 5677, 1010, 4333, 1007, 1063, 13075, 6922, 3207, 23460, 2094, 1025, 13075, 2951, 1025, 13075, 12398, 10175, 5657, 1025, 13075, 3145, 1025, 13075, 4666, 23938, 2696, 1025, 13075, 2279, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js
function (oInstance, sMetaPath, mTypeForMetaPath) { var aKeyProperties = [], mKey2Value = _Helper.getKeyProperties(oInstance, sMetaPath, mTypeForMetaPath, true); if (!mKey2Value) { return undefined; } aKeyProperties = Object.keys(mKey2Value).map(function (sAlias, iIndex, aKeys) { var vValue = encodeURIComponent(mKey2Value[sAlias]); return aKeys.length === 1 ? vValue : encodeURIComponent(sAlias) + "=" + vValue; }); return "(" + aKeyProperties.join(",") + ")"; }
javascript
function (oInstance, sMetaPath, mTypeForMetaPath) { var aKeyProperties = [], mKey2Value = _Helper.getKeyProperties(oInstance, sMetaPath, mTypeForMetaPath, true); if (!mKey2Value) { return undefined; } aKeyProperties = Object.keys(mKey2Value).map(function (sAlias, iIndex, aKeys) { var vValue = encodeURIComponent(mKey2Value[sAlias]); return aKeys.length === 1 ? vValue : encodeURIComponent(sAlias) + "=" + vValue; }); return "(" + aKeyProperties.join(",") + ")"; }
[ "function", "(", "oInstance", ",", "sMetaPath", ",", "mTypeForMetaPath", ")", "{", "var", "aKeyProperties", "=", "[", "]", ",", "mKey2Value", "=", "_Helper", ".", "getKeyProperties", "(", "oInstance", ",", "sMetaPath", ",", "mTypeForMetaPath", ",", "true", ")"...
Returns the key predicate (see "4.3.1 Canonical URL") for the given entity using the given meta data. @param {object} oInstance Entity instance runtime data @param {string} sMetaPath The absolute meta path of the given instance @param {object} mTypeForMetaPath Maps meta paths to the corresponding entity or complex types @returns {string} The key predicate, e.g. "(Sector='DevOps',ID='42')" or "('42')", or undefined, if at least one key property is undefined @throws {Error} In case the entity type has no key properties according to metadata
[ "Returns", "the", "key", "predicate", "(", "see", "4", ".", "3", ".", "1", "Canonical", "URL", ")", "for", "the", "given", "entity", "using", "the", "given", "meta", "data", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js#L532-L546
train
Returns the key property string for the given instance
[ 30522, 3853, 1006, 1051, 7076, 26897, 1010, 15488, 12928, 15069, 1010, 11047, 18863, 14192, 12928, 15069, 1007, 1063, 13075, 17712, 3240, 21572, 4842, 7368, 1027, 1031, 1033, 1010, 12395, 3240, 2475, 10175, 5657, 1027, 1035, 2393, 2121, 1012,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js
function(sParameterName, sValue, sToValue) { var oParameter = this._oParameterization.findParameterByName(sParameterName); if (!oParameter) { throw "Invalid parameter name " + sParameterName; // TODO improve } // error handling if (sToValue != null) { if (!oParameter.isIntervalBoundary()) { // TODO improve error handling throw "Range value cannot be applied to parameter " + sParameterName + " accepting only single values"; // TODO } if (!oParameter.isLowerIntervalBoundary()) { // TODO improve error handling throw "Range value given, but parameter " + sParameterName + " does not hold the lower boundary"; // TODO } } if (!oParameter.isIntervalBoundary()) { if (sValue == null) { delete this._oParameterValueAssignment[sParameterName]; } else { this._oParameterValueAssignment[sParameterName] = sValue; } } else { if (sValue == null && sToValue != null) { throw "Parameter " + sParameterName + ": An upper boundary cannot be given without the lower boundary"; // TODO } if (sValue == null) { delete this._oParameterValueAssignment[sParameterName]; sToValue = null; } else { this._oParameterValueAssignment[sParameterName] = sValue; } var oUpperBoundaryParameter = oParameter.getPeerIntervalBoundaryParameter(); if (sToValue == null) { sToValue = sValue; } if (sValue == null) { delete this._oParameterValueAssignment[oUpperBoundaryParameter.getName()]; } else { this._oParameterValueAssignment[oUpperBoundaryParameter.getName()] = sToValue; } } return; }
javascript
function(sParameterName, sValue, sToValue) { var oParameter = this._oParameterization.findParameterByName(sParameterName); if (!oParameter) { throw "Invalid parameter name " + sParameterName; // TODO improve } // error handling if (sToValue != null) { if (!oParameter.isIntervalBoundary()) { // TODO improve error handling throw "Range value cannot be applied to parameter " + sParameterName + " accepting only single values"; // TODO } if (!oParameter.isLowerIntervalBoundary()) { // TODO improve error handling throw "Range value given, but parameter " + sParameterName + " does not hold the lower boundary"; // TODO } } if (!oParameter.isIntervalBoundary()) { if (sValue == null) { delete this._oParameterValueAssignment[sParameterName]; } else { this._oParameterValueAssignment[sParameterName] = sValue; } } else { if (sValue == null && sToValue != null) { throw "Parameter " + sParameterName + ": An upper boundary cannot be given without the lower boundary"; // TODO } if (sValue == null) { delete this._oParameterValueAssignment[sParameterName]; sToValue = null; } else { this._oParameterValueAssignment[sParameterName] = sValue; } var oUpperBoundaryParameter = oParameter.getPeerIntervalBoundaryParameter(); if (sToValue == null) { sToValue = sValue; } if (sValue == null) { delete this._oParameterValueAssignment[oUpperBoundaryParameter.getName()]; } else { this._oParameterValueAssignment[oUpperBoundaryParameter.getName()] = sToValue; } } return; }
[ "function", "(", "sParameterName", ",", "sValue", ",", "sToValue", ")", "{", "var", "oParameter", "=", "this", ".", "_oParameterization", ".", "findParameterByName", "(", "sParameterName", ")", ";", "if", "(", "!", "oParameter", ")", "{", "throw", "\"Invalid p...
Assign a value to a parameter @param {String} sParameterName Name of the parameter. In case of a range value, provide the name of the lower boundary parameter. @param {String} sValue Assigned value. Pass null to remove a value assignment. @param {String} sToValue Omit it or set it to null for single values. If set, it will be assigned to the upper boundary parameter @public @function @name sap.ui.model.analytics.odata4analytics.ParameterizationRequest#setParameterValue
[ "Assign", "a", "value", "to", "a", "parameter" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3898-L3941
train
Sets the value of a parameter
[ 30522, 3853, 1006, 12403, 6444, 15141, 18442, 1010, 17917, 2389, 5657, 1010, 2358, 7103, 7630, 2063, 1007, 1063, 13075, 6728, 5400, 22828, 1027, 2023, 1012, 1035, 6728, 5400, 22828, 3989, 1012, 2424, 28689, 22828, 3762, 18442, 1006, 12403, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/AppInit.js
_addListener
function _addListener(type, handler) { if (_status[type]) { _callHandler(handler); } else { _callbacks[type].push(handler); } }
javascript
function _addListener(type, handler) { if (_status[type]) { _callHandler(handler); } else { _callbacks[type].push(handler); } }
[ "function", "_addListener", "(", "type", ",", "handler", ")", "{", "if", "(", "_status", "[", "type", "]", ")", "{", "_callHandler", "(", "handler", ")", ";", "}", "else", "{", "_callbacks", "[", "type", "]", ".", "push", "(", "handler", ")", ";", ...
/* adds a callback to the list of functions to call for the specified event type @param {string} type - the event type to dispatch (APP_READY, EXTENSIONS_READY, HTML_READY) @param {function} handler - callback funciton to call when the event is triggered @private
[ "/", "*", "adds", "a", "callback", "to", "the", "list", "of", "functions", "to", "call", "for", "the", "specified", "event", "type" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/AppInit.js#L122-L128
train
Add a listener to the event queue
[ 30522, 3853, 1035, 5587, 9863, 24454, 1006, 2828, 1010, 28213, 1007, 1063, 2065, 1006, 1035, 3570, 1031, 2828, 1033, 1007, 1063, 1035, 2655, 11774, 3917, 1006, 28213, 1007, 1025, 1065, 2842, 1063, 1035, 2655, 12221, 1031, 2828, 1033, 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...
ColorlibHQ/AdminLTE
plugins/input-mask/jquery.inputmask.date.extensions.js
function (chrs, buffer, pos, strict, opts) { var isValid = opts.regex.val1.test(chrs); if (!strict && !isValid) { if (chrs.charAt(1) == opts.separator || "-./".indexOf(chrs.charAt(1)) != -1) { isValid = opts.regex.val1.test("0" + chrs.charAt(0)); if (isValid) { buffer[pos - 1] = "0"; return { "pos": pos, "c": chrs.charAt(0) }; } } } return isValid; }
javascript
function (chrs, buffer, pos, strict, opts) { var isValid = opts.regex.val1.test(chrs); if (!strict && !isValid) { if (chrs.charAt(1) == opts.separator || "-./".indexOf(chrs.charAt(1)) != -1) { isValid = opts.regex.val1.test("0" + chrs.charAt(0)); if (isValid) { buffer[pos - 1] = "0"; return { "pos": pos, "c": chrs.charAt(0) }; } } } return isValid; }
[ "function", "(", "chrs", ",", "buffer", ",", "pos", ",", "strict", ",", "opts", ")", "{", "var", "isValid", "=", "opts", ".", "regex", ".", "val1", ".", "test", "(", "chrs", ")", ";", "if", "(", "!", "strict", "&&", "!", "isValid", ")", "{", "i...
val1 ~ day or month
[ "val1", "~", "day", "or", "month" ]
19113c3cbc19a7afe0cfd3158d647064d2d30661
https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/input-mask/jquery.inputmask.date.extensions.js#L86-L98
train
Check if the character is valid
[ 30522, 3853, 1006, 10381, 2869, 1010, 17698, 1010, 13433, 2015, 1010, 9384, 1010, 23569, 2015, 1007, 1063, 13075, 2003, 10175, 3593, 1027, 23569, 2015, 1012, 19723, 10288, 1012, 11748, 2487, 1012, 3231, 1006, 10381, 2869, 1007, 1025, 2065, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
angular/material
src/components/slider/slider.js
percentToValue
function percentToValue(percent) { var adjustedPercent = invert ? (1 - percent) : percent; return (min + adjustedPercent * (max - min)); }
javascript
function percentToValue(percent) { var adjustedPercent = invert ? (1 - percent) : percent; return (min + adjustedPercent * (max - min)); }
[ "function", "percentToValue", "(", "percent", ")", "{", "var", "adjustedPercent", "=", "invert", "?", "(", "1", "-", "percent", ")", ":", "percent", ";", "return", "(", "min", "+", "adjustedPercent", "*", "(", "max", "-", "min", ")", ")", ";", "}" ]
Convert percentage offset on slide to equivalent model value @param percent @returns {*}
[ "Convert", "percentage", "offset", "on", "slide", "to", "equivalent", "model", "value" ]
84ac558674e73958be84312444c48d9f823f6684
https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/slider/slider.js#L662-L665
train
Converts a percent value to a number
[ 30522, 3853, 3867, 26525, 2389, 5657, 1006, 3867, 1007, 1063, 13075, 10426, 4842, 13013, 1027, 1999, 16874, 1029, 1006, 1015, 1011, 3867, 1007, 1024, 3867, 1025, 2709, 1006, 8117, 1009, 10426, 4842, 13013, 1008, 1006, 4098, 1011, 8117, 1007...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/qunit/QUnitUtils.js
calcCost
function calcCost(a, va) { var score = { va: va, pairs:0, redundant:0 }; for (var c = 0; c < N; c++) { var count; if ( c < a ) { count = occurs[offset(c,a,value_index[c],va)]; } else if ( c > a ) { var j = offset(a,c,va,0), end = j + params[c].n; for (count = occurs[j]; count > 0 && i < end; j++ ) { if ( occurs[j] < count ) { count = occurs[j]; } } } score.redundant = score.redundant + count; if ( count == 0 ) { score.pairs++; } } return score; }
javascript
function calcCost(a, va) { var score = { va: va, pairs:0, redundant:0 }; for (var c = 0; c < N; c++) { var count; if ( c < a ) { count = occurs[offset(c,a,value_index[c],va)]; } else if ( c > a ) { var j = offset(a,c,va,0), end = j + params[c].n; for (count = occurs[j]; count > 0 && i < end; j++ ) { if ( occurs[j] < count ) { count = occurs[j]; } } } score.redundant = score.redundant + count; if ( count == 0 ) { score.pairs++; } } return score; }
[ "function", "calcCost", "(", "a", ",", "va", ")", "{", "var", "score", "=", "{", "va", ":", "va", ",", "pairs", ":", "0", ",", "redundant", ":", "0", "}", ";", "for", "(", "var", "c", "=", "0", ";", "c", "<", "N", ";", "c", "++", ")", "{"...
Calculates a cost function for the case where for property 'a' the value 'va' is taken. The calculated cost consists of two parts: - pairs : number of newly addressed unique pairs - redundant : number of redundantly added pairs @param a @param va @return
[ "Calculates", "a", "cost", "function", "for", "the", "case", "where", "for", "property", "a", "the", "value", "va", "is", "taken", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/qunit/QUnitUtils.js#L1001-L1022
train
Calculate cost of a value
[ 30522, 3853, 10250, 21408, 3367, 1006, 1037, 1010, 12436, 1007, 1063, 13075, 3556, 1027, 1063, 12436, 1024, 12436, 1010, 7689, 1024, 1014, 1010, 21707, 1024, 1014, 1065, 1025, 2005, 1006, 13075, 1039, 1027, 1014, 1025, 1039, 1026, 30524, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/events/isSpecialKey.js
isArrowKey
function isArrowKey(oEvent) { var sKey = oEvent.key; // based on KeyBoardEvent.key (https://www.w3.org/TR/uievents/) and (https://www.w3.org/TR/uievents-key/) // MS special case: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8860571/ return (sKey === 'ArrowLeft') || (sKey === 'ArrowUp') || (sKey === 'ArrowRight') || (sKey === 'ArrowDown') || (sKey === 'Left') || // 'Left' IE compatibility (sKey === 'Up') || // 'Up' IE compatibility (sKey === 'Right') || // 'Right' IE compatibility (sKey === 'Down'); // 'Down' IE compatibility }
javascript
function isArrowKey(oEvent) { var sKey = oEvent.key; // based on KeyBoardEvent.key (https://www.w3.org/TR/uievents/) and (https://www.w3.org/TR/uievents-key/) // MS special case: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8860571/ return (sKey === 'ArrowLeft') || (sKey === 'ArrowUp') || (sKey === 'ArrowRight') || (sKey === 'ArrowDown') || (sKey === 'Left') || // 'Left' IE compatibility (sKey === 'Up') || // 'Up' IE compatibility (sKey === 'Right') || // 'Right' IE compatibility (sKey === 'Down'); // 'Down' IE compatibility }
[ "function", "isArrowKey", "(", "oEvent", ")", "{", "var", "sKey", "=", "oEvent", ".", "key", ";", "// based on KeyBoardEvent.key (https://www.w3.org/TR/uievents/) and (https://www.w3.org/TR/uievents-key/)", "// MS special case: https://developer.microsoft.com/en-us/microsoft-edge/platfor...
Detect whether the pressed key is a navigation key. Navigation keys are considered: ARROW_LEFT, ARROW_UP, ARROW_RIGHT, ARROW_DOWN @param {jQuery.Event} oEvent The event object of the <code>keydown</code>, <code>keyup</code> or <code>keypress</code> events. @static @returns {boolean} True if a arrow key was pressed
[ "Detect", "whether", "the", "pressed", "key", "is", "a", "navigation", "key", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/events/isSpecialKey.js#L60-L72
train
Checks if the event is an arrow key
[ 30522, 3853, 18061, 28597, 14839, 1006, 1051, 18697, 3372, 1007, 1063, 13075, 15315, 3240, 1027, 1051, 18697, 3372, 1012, 3145, 1025, 1013, 1013, 2241, 2006, 9019, 18697, 3372, 1012, 3145, 1006, 16770, 1024, 1013, 1013, 7479, 1012, 1059, 25...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
aws/aws-sdk-js
scripts/lib/translator.js
each
function each(obj, iter) { for (var key in obj) { if (obj.hasOwnProperty(key)) iter(key, obj[key]); } }
javascript
function each(obj, iter) { for (var key in obj) { if (obj.hasOwnProperty(key)) iter(key, obj[key]); } }
[ "function", "each", "(", "obj", ",", "iter", ")", "{", "for", "(", "var", "key", "in", "obj", ")", "{", "if", "(", "obj", ".", "hasOwnProperty", "(", "key", ")", ")", "iter", "(", "key", ",", "obj", "[", "key", "]", ")", ";", "}", "}" ]
/* A couple of utility methods
[ "/", "*", "A", "couple", "of", "utility", "methods" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/scripts/lib/translator.js#L3-L7
train
Iterate over an object.
[ 30522, 3853, 2169, 1006, 27885, 3501, 1010, 2009, 2121, 1007, 1063, 2005, 1006, 13075, 3145, 1999, 27885, 3501, 1007, 1063, 2065, 1006, 27885, 3501, 1012, 2038, 12384, 21572, 4842, 3723, 30524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
ColorlibHQ/AdminLTE
bower_components/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js
function(val) { return new Color( val ? val : null, this.options.colorSelectors, this.options.fallbackColor ? this.options.fallbackColor : this.color, this.options.fallbackFormat, this.options.hexNumberSignPrefix ); }
javascript
function(val) { return new Color( val ? val : null, this.options.colorSelectors, this.options.fallbackColor ? this.options.fallbackColor : this.color, this.options.fallbackFormat, this.options.hexNumberSignPrefix ); }
[ "function", "(", "val", ")", "{", "return", "new", "Color", "(", "val", "?", "val", ":", "null", ",", "this", ".", "options", ".", "colorSelectors", ",", "this", ".", "options", ".", "fallbackColor", "?", "this", ".", "options", ".", "fallbackColor", "...
Creates a new color using the instance options @protected @param {String} val @returns {Color}
[ "Creates", "a", "new", "color", "using", "the", "instance", "options" ]
19113c3cbc19a7afe0cfd3158d647064d2d30661
https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js#L1081-L1089
train
Returns the color object for the current record
[ 30522, 3853, 1006, 11748, 1007, 1063, 2709, 2047, 3609, 1006, 11748, 1029, 11748, 1024, 19701, 1010, 2023, 1012, 7047, 1012, 6087, 12260, 24817, 1010, 2023, 1012, 7047, 1012, 2991, 5963, 18717, 1029, 2023, 1012, 7047, 1012, 2991, 5963, 1871...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/sessionstore.js
aboutSessionRestore_getElement
function aboutSessionRestore_getElement(spec) { var elem = null; switch(spec.type) { case "button_restoreSession": elem = new elementslib.ID(this._controller.tabs.activeTab, "errorTryAgain"); break; case "error_longDesc": elem = new elementslib.ID(this._controller.tabs.activeTab, "errorLongDesc"); break; case "error_pageContainer": elem = new elementslib.ID(this._controller.tabs.activeTab, "errorPageContainer"); break; case "error_shortDesc": elem = new elementslib.ID(this._controller.tabs.activeTab, "errorShortDescText"); break; case "error_title": elem = new elementslib.ID(this._controller.tabs.activeTab, "errorTitleText"); break; case "tabList": elem = new elementslib.ID(this._controller.window.document, "tabList"); break; default: throw new Error(arguments.callee.name + ": Unknown element type - " + spec.type); } return elem; }
javascript
function aboutSessionRestore_getElement(spec) { var elem = null; switch(spec.type) { case "button_restoreSession": elem = new elementslib.ID(this._controller.tabs.activeTab, "errorTryAgain"); break; case "error_longDesc": elem = new elementslib.ID(this._controller.tabs.activeTab, "errorLongDesc"); break; case "error_pageContainer": elem = new elementslib.ID(this._controller.tabs.activeTab, "errorPageContainer"); break; case "error_shortDesc": elem = new elementslib.ID(this._controller.tabs.activeTab, "errorShortDescText"); break; case "error_title": elem = new elementslib.ID(this._controller.tabs.activeTab, "errorTitleText"); break; case "tabList": elem = new elementslib.ID(this._controller.window.document, "tabList"); break; default: throw new Error(arguments.callee.name + ": Unknown element type - " + spec.type); } return elem; }
[ "function", "aboutSessionRestore_getElement", "(", "spec", ")", "{", "var", "elem", "=", "null", ";", "switch", "(", "spec", ".", "type", ")", "{", "case", "\"button_restoreSession\"", ":", "elem", "=", "new", "elementslib", ".", "ID", "(", "this", ".", "_...
Retrieve an UI element based on the given spec @param {object} spec Information of the UI element which should be retrieved type: General type information subtype: Specific element or property value: Value of the element or property @returns Element which has been created @type {ElemBase}
[ "Retrieve", "an", "UI", "element", "based", "on", "the", "given", "spec" ]
38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd
https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/sessionstore.js#L117-L144
train
Get the element that is used to restore the session
[ 30522, 3853, 2055, 8583, 10992, 28533, 5686, 1035, 2131, 12260, 3672, 1006, 28699, 1007, 1063, 13075, 3449, 6633, 1027, 19701, 1025, 6942, 1006, 28699, 1012, 2828, 1007, 1063, 2553, 1000, 6462, 1035, 9239, 8583, 10992, 1000, 1024, 3449, 663...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
heyui/heyui
src/plugins/popper/index.js
Popper
function Popper(reference, popper) { var _this = this; var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; classCallCheck(this, Popper); this.scheduleUpdate = function () { return requestAnimation(_this.update); }; // make update() debounced, so that it only runs at most once-per-tick this.update = debounce(this.update.bind(this)); // with {} we create a new object with the options inside it this.defaultOptions = options; this.options = _extends({}, Popper.Defaults, options); // init state this.state = { isDestroyed: false, isCreated: false, scrollParents: [] }; // get reference and popper elements (allow jQuery wrappers) this.reference = reference && reference.jquery ? reference[0] : reference; this.popper = popper && popper.jquery ? popper[0] : popper; this.updateModifiers(); // fire the first update to position the popper in the right place this.update(); var eventsEnabled = this.options.eventsEnabled; if (eventsEnabled) { // setup event listeners, they will take care of update the position in specific situations this.enableEventListeners(); } this.state.eventsEnabled = eventsEnabled; }
javascript
function Popper(reference, popper) { var _this = this; var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; classCallCheck(this, Popper); this.scheduleUpdate = function () { return requestAnimation(_this.update); }; // make update() debounced, so that it only runs at most once-per-tick this.update = debounce(this.update.bind(this)); // with {} we create a new object with the options inside it this.defaultOptions = options; this.options = _extends({}, Popper.Defaults, options); // init state this.state = { isDestroyed: false, isCreated: false, scrollParents: [] }; // get reference and popper elements (allow jQuery wrappers) this.reference = reference && reference.jquery ? reference[0] : reference; this.popper = popper && popper.jquery ? popper[0] : popper; this.updateModifiers(); // fire the first update to position the popper in the right place this.update(); var eventsEnabled = this.options.eventsEnabled; if (eventsEnabled) { // setup event listeners, they will take care of update the position in specific situations this.enableEventListeners(); } this.state.eventsEnabled = eventsEnabled; }
[ "function", "Popper", "(", "reference", ",", "popper", ")", "{", "var", "_this", "=", "this", ";", "var", "options", "=", "arguments", ".", "length", ">", "2", "&&", "arguments", "[", "2", "]", "!==", "undefined", "?", "arguments", "[", "2", "]", ":"...
Create a new Popper.js instance @class Popper @param {HTMLElement|referenceObject} reference - The reference element used to position the popper @param {HTMLElement} popper - The HTML element used as popper. @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) @return {Object} instance - The generated Popper.js instance
[ "Create", "a", "new", "Popper", ".", "js", "instance" ]
d5405d27d994151b676eb91c12b389316d7f6679
https://github.com/heyui/heyui/blob/d5405d27d994151b676eb91c12b389316d7f6679/src/plugins/popper/index.js#L2433-L2473
train
Construct a new Popper instance
[ 30522, 3853, 3769, 4842, 1006, 4431, 1010, 3769, 4842, 1007, 1063, 13075, 1035, 2023, 1027, 2023, 1025, 13075, 7047, 1027, 9918, 1012, 3091, 1028, 1016, 1004, 1004, 9918, 1031, 1016, 1033, 999, 1027, 1027, 6151, 28344, 1029, 9918, 1031, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperExpression.js
function (oInterface, oPathValue) { var oName = Basics.descend(oPathValue, "Name", "string"), oParameters = Basics.descend(oPathValue, "Parameters"); switch (oName.value) { case "odata.concat": // 14.5.3.1.1 Function odata.concat return Expression.concat(oInterface, oParameters); case "odata.fillUriTemplate": // 14.5.3.1.2 Function odata.fillUriTemplate return Expression.fillUriTemplate(oInterface, oParameters); case "odata.uriEncode": // 14.5.3.1.3 Function odata.uriEncode return Expression.uriEncode(oInterface, oParameters); default: Basics.error(oName, "unknown function: " + oName.value); } }
javascript
function (oInterface, oPathValue) { var oName = Basics.descend(oPathValue, "Name", "string"), oParameters = Basics.descend(oPathValue, "Parameters"); switch (oName.value) { case "odata.concat": // 14.5.3.1.1 Function odata.concat return Expression.concat(oInterface, oParameters); case "odata.fillUriTemplate": // 14.5.3.1.2 Function odata.fillUriTemplate return Expression.fillUriTemplate(oInterface, oParameters); case "odata.uriEncode": // 14.5.3.1.3 Function odata.uriEncode return Expression.uriEncode(oInterface, oParameters); default: Basics.error(oName, "unknown function: " + oName.value); } }
[ "function", "(", "oInterface", ",", "oPathValue", ")", "{", "var", "oName", "=", "Basics", ".", "descend", "(", "oPathValue", ",", "\"Name\"", ",", "\"string\"", ")", ",", "oParameters", "=", "Basics", ".", "descend", "(", "oPathValue", ",", "\"Parameters\""...
Handling of "14.5.3 Expression edm:Apply". @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 apply (see Expression object) @returns {object} the result object
[ "Handling", "of", "14", ".", "5", ".", "3", "Expression", "edm", ":", "Apply", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperExpression.js#L164-L178
train
returns the function that is defined in the path
[ 30522, 3853, 1006, 1051, 18447, 2121, 12172, 1010, 6728, 8988, 10175, 5657, 1007, 1063, 13075, 2006, 14074, 1027, 24078, 1012, 18855, 1006, 6728, 8988, 10175, 5657, 1010, 1000, 2171, 1000, 1010, 1000, 5164, 1000, 1007, 1010, 6728, 5400, 228...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
keplergl/kepler.gl
scripts/documentation.js
_appendActionToUpdaters
function _appendActionToUpdaters(node, actionMap) { if (node.members && node.members.static.length) { node.members.static = node.members.static.map(nd => _appendActionToUpdaters(nd, actionMap)); } const updater = node.name; const action = Object.values(actionMap) .find(action => action.updaters.find(up => up.name === updater)); if (!action) { return node; } const actionName = action.name; const mdContent = ` * __Action__: [${BT}${actionName}${BT}](../actions/actions.md#${actionName.toLowerCase()}) `; return _appendListToDescription(node, mdContent); }
javascript
function _appendActionToUpdaters(node, actionMap) { if (node.members && node.members.static.length) { node.members.static = node.members.static.map(nd => _appendActionToUpdaters(nd, actionMap)); } const updater = node.name; const action = Object.values(actionMap) .find(action => action.updaters.find(up => up.name === updater)); if (!action) { return node; } const actionName = action.name; const mdContent = ` * __Action__: [${BT}${actionName}${BT}](../actions/actions.md#${actionName.toLowerCase()}) `; return _appendListToDescription(node, mdContent); }
[ "function", "_appendActionToUpdaters", "(", "node", ",", "actionMap", ")", "{", "if", "(", "node", ".", "members", "&&", "node", ".", "members", ".", "static", ".", "length", ")", "{", "node", ".", "members", ".", "static", "=", "node", ".", "members", ...
Add action to linked updaters @param {Object} node @param {Object} actionMap
[ "Add", "action", "to", "linked", "updaters" ]
779238435707cc54335c2d00001e4b9334b314aa
https://github.com/keplergl/kepler.gl/blob/779238435707cc54335c2d00001e4b9334b314aa/scripts/documentation.js#L143-L163
train
Append action to updater list
[ 30522, 3853, 1035, 10439, 10497, 18908, 3258, 24826, 17299, 24932, 2015, 1006, 13045, 1010, 2895, 2863, 2361, 1007, 1063, 2065, 1006, 13045, 1012, 2372, 1004, 1004, 13045, 1012, 2372, 1012, 10763, 1012, 3091, 1007, 1063, 13045, 1012, 2372, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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
handleRename
function handleRename(response) { if (response.error) { EditorManager.getActiveEditor().displayErrorMessageAtCursor(response.error); return; } var file = response.file, offset = response.offset; var $deferredFindRefs = getPendingRequest(file, offset, MessageIds.TERN_REFS); if ($deferredFindRefs) { $deferredFindRefs.resolveWith(null, [response]); } }
javascript
function handleRename(response) { if (response.error) { EditorManager.getActiveEditor().displayErrorMessageAtCursor(response.error); return; } var file = response.file, offset = response.offset; var $deferredFindRefs = getPendingRequest(file, offset, MessageIds.TERN_REFS); if ($deferredFindRefs) { $deferredFindRefs.resolveWith(null, [response]); } }
[ "function", "handleRename", "(", "response", ")", "{", "if", "(", "response", ".", "error", ")", "{", "EditorManager", ".", "getActiveEditor", "(", ")", ".", "displayErrorMessageAtCursor", "(", "response", ".", "error", ")", ";", "return", ";", "}", "var", ...
Handle the response from the tern node domain when it responds with the references @param response - the response from the node domain
[ "Handle", "the", "response", "from", "the", "tern", "node", "domain", "when", "it", "responds", "with", "the", "references" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L386-L401
train
Handle rename request
[ 30522, 3853, 28213, 8189, 4168, 1006, 3433, 1007, 1063, 2065, 1006, 3433, 1012, 7561, 1007, 1063, 3559, 24805, 4590, 1012, 2131, 19620, 2098, 15660, 1006, 1007, 1012, 4653, 2121, 29165, 7834, 3736, 3351, 4017, 10841, 25301, 2099, 1006, 3433...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/extensibility/node/ExtensionManagerDomain.js
_endDownload
function _endDownload(downloadId, error) { var downloadInfo = pendingDownloads[downloadId]; delete pendingDownloads[downloadId]; if (error) { // Abort the download if still pending // Note that this will trigger response's "end" event downloadInfo.request.abort(); // Clean up any partially-downloaded file // (if no outStream, then we never got a response back yet and never created any file) if (downloadInfo.outStream) { downloadInfo.outStream.end(function () { fs.unlink(downloadInfo.localPath); }); } downloadInfo.callback(error, null); } else { // Download completed successfully. Flush stream to disk and THEN signal completion downloadInfo.outStream.end(function () { downloadInfo.callback(null, downloadInfo.localPath); }); } }
javascript
function _endDownload(downloadId, error) { var downloadInfo = pendingDownloads[downloadId]; delete pendingDownloads[downloadId]; if (error) { // Abort the download if still pending // Note that this will trigger response's "end" event downloadInfo.request.abort(); // Clean up any partially-downloaded file // (if no outStream, then we never got a response back yet and never created any file) if (downloadInfo.outStream) { downloadInfo.outStream.end(function () { fs.unlink(downloadInfo.localPath); }); } downloadInfo.callback(error, null); } else { // Download completed successfully. Flush stream to disk and THEN signal completion downloadInfo.outStream.end(function () { downloadInfo.callback(null, downloadInfo.localPath); }); } }
[ "function", "_endDownload", "(", "downloadId", ",", "error", ")", "{", "var", "downloadInfo", "=", "pendingDownloads", "[", "downloadId", "]", ";", "delete", "pendingDownloads", "[", "downloadId", "]", ";", "if", "(", "error", ")", "{", "// Abort the download if...
Wrap up after the given download has terminated (successfully or not). Closes connections, calls back the client's callback, and IF there was an error, delete any partially-downloaded file. @param {string} downloadId Unique id originally passed to _cmdDownloadFile() @param {?string} error If null, download was treated as successful
[ "Wrap", "up", "after", "the", "given", "download", "has", "terminated", "(", "successfully", "or", "not", ")", ".", "Closes", "connections", "calls", "back", "the", "client", "s", "callback", "and", "IF", "there", "was", "an", "error", "delete", "any", "pa...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/ExtensionManagerDomain.js#L356-L381
train
End the download
[ 30522, 3853, 1035, 2203, 7698, 11066, 1006, 8816, 3593, 1010, 7561, 1007, 1063, 13075, 8816, 2378, 14876, 1027, 14223, 7698, 11066, 2015, 1031, 8816, 3593, 1033, 1025, 3972, 12870, 14223, 7698, 11066, 2015, 1031, 8816, 3593, 1033, 1025, 206...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.m/src/sap/m/GrowingEnablement.js
function(sChangeReason) { this._bLoading = false; this._updateTriggerDelayed(false); this._oControl.onAfterPageLoaded(this.getInfo(), sChangeReason); // After the data has been loaded, restore the busy indicator handling of the parent control. if (this._oControl.setEnableBusyIndicator) { this._oControl.setEnableBusyIndicator(this._bParentEnableBusyIndicator); } }
javascript
function(sChangeReason) { this._bLoading = false; this._updateTriggerDelayed(false); this._oControl.onAfterPageLoaded(this.getInfo(), sChangeReason); // After the data has been loaded, restore the busy indicator handling of the parent control. if (this._oControl.setEnableBusyIndicator) { this._oControl.setEnableBusyIndicator(this._bParentEnableBusyIndicator); } }
[ "function", "(", "sChangeReason", ")", "{", "this", ".", "_bLoading", "=", "false", ";", "this", ".", "_updateTriggerDelayed", "(", "false", ")", ";", "this", ".", "_oControl", ".", "onAfterPageLoaded", "(", "this", ".", "getInfo", "(", ")", ",", "sChangeR...
called after new page loaded
[ "called", "after", "new", "page", "loaded" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/GrowingEnablement.js#L200-L209
train
Called after the page has been loaded
[ 30522, 3853, 1006, 8040, 18003, 7869, 3022, 2239, 1007, 1063, 2023, 1012, 1035, 1038, 18570, 1027, 6270, 1025, 2023, 1012, 1035, 10651, 18886, 13327, 9247, 4710, 2098, 1006, 6270, 1007, 1025, 2023, 1012, 1035, 1051, 8663, 13181, 2140, 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...
markdown-it/markdown-it
lib/index.js
MarkdownIt
function MarkdownIt(presetName, options) { if (!(this instanceof MarkdownIt)) { return new MarkdownIt(presetName, options); } if (!options) { if (!utils.isString(presetName)) { options = presetName || {}; presetName = 'default'; } } /** * MarkdownIt#inline -> ParserInline * * Instance of [[ParserInline]]. You may need it to add new rules when * writing plugins. For simple rules control use [[MarkdownIt.disable]] and * [[MarkdownIt.enable]]. **/ this.inline = new ParserInline(); /** * MarkdownIt#block -> ParserBlock * * Instance of [[ParserBlock]]. You may need it to add new rules when * writing plugins. For simple rules control use [[MarkdownIt.disable]] and * [[MarkdownIt.enable]]. **/ this.block = new ParserBlock(); /** * MarkdownIt#core -> Core * * Instance of [[Core]] chain executor. You may need it to add new rules when * writing plugins. For simple rules control use [[MarkdownIt.disable]] and * [[MarkdownIt.enable]]. **/ this.core = new ParserCore(); /** * MarkdownIt#renderer -> Renderer * * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering * rules for new token types, generated by plugins. * * ##### Example * * ```javascript * var md = require('markdown-it')(); * * function myToken(tokens, idx, options, env, self) { * //... * return result; * }; * * md.renderer.rules['my_token'] = myToken * ``` * * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js). **/ this.renderer = new Renderer(); /** * MarkdownIt#linkify -> LinkifyIt * * [linkify-it](https://github.com/markdown-it/linkify-it) instance. * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js) * rule. **/ this.linkify = new LinkifyIt(); /** * MarkdownIt#validateLink(url) -> Boolean * * Link validation function. CommonMark allows too much in links. By default * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas * except some embedded image types. * * You can change this behaviour: * * ```javascript * var md = require('markdown-it')(); * // enable everything * md.validateLink = function () { return true; } * ``` **/ this.validateLink = validateLink; /** * MarkdownIt#normalizeLink(url) -> String * * Function used to encode link url to a machine-readable format, * which includes url-encoding, punycode, etc. **/ this.normalizeLink = normalizeLink; /** * MarkdownIt#normalizeLinkText(url) -> String * * Function used to decode link url to a human-readable format` **/ this.normalizeLinkText = normalizeLinkText; // Expose utils & helpers for easy acces from plugins /** * MarkdownIt#utils -> utils * * Assorted utility functions, useful to write plugins. See details * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.js). **/ this.utils = utils; /** * MarkdownIt#helpers -> helpers * * Link components parser functions, useful to write plugins. See details * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers). **/ this.helpers = utils.assign({}, helpers); this.options = {}; this.configure(presetName); if (options) { this.set(options); } }
javascript
function MarkdownIt(presetName, options) { if (!(this instanceof MarkdownIt)) { return new MarkdownIt(presetName, options); } if (!options) { if (!utils.isString(presetName)) { options = presetName || {}; presetName = 'default'; } } /** * MarkdownIt#inline -> ParserInline * * Instance of [[ParserInline]]. You may need it to add new rules when * writing plugins. For simple rules control use [[MarkdownIt.disable]] and * [[MarkdownIt.enable]]. **/ this.inline = new ParserInline(); /** * MarkdownIt#block -> ParserBlock * * Instance of [[ParserBlock]]. You may need it to add new rules when * writing plugins. For simple rules control use [[MarkdownIt.disable]] and * [[MarkdownIt.enable]]. **/ this.block = new ParserBlock(); /** * MarkdownIt#core -> Core * * Instance of [[Core]] chain executor. You may need it to add new rules when * writing plugins. For simple rules control use [[MarkdownIt.disable]] and * [[MarkdownIt.enable]]. **/ this.core = new ParserCore(); /** * MarkdownIt#renderer -> Renderer * * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering * rules for new token types, generated by plugins. * * ##### Example * * ```javascript * var md = require('markdown-it')(); * * function myToken(tokens, idx, options, env, self) { * //... * return result; * }; * * md.renderer.rules['my_token'] = myToken * ``` * * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js). **/ this.renderer = new Renderer(); /** * MarkdownIt#linkify -> LinkifyIt * * [linkify-it](https://github.com/markdown-it/linkify-it) instance. * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js) * rule. **/ this.linkify = new LinkifyIt(); /** * MarkdownIt#validateLink(url) -> Boolean * * Link validation function. CommonMark allows too much in links. By default * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas * except some embedded image types. * * You can change this behaviour: * * ```javascript * var md = require('markdown-it')(); * // enable everything * md.validateLink = function () { return true; } * ``` **/ this.validateLink = validateLink; /** * MarkdownIt#normalizeLink(url) -> String * * Function used to encode link url to a machine-readable format, * which includes url-encoding, punycode, etc. **/ this.normalizeLink = normalizeLink; /** * MarkdownIt#normalizeLinkText(url) -> String * * Function used to decode link url to a human-readable format` **/ this.normalizeLinkText = normalizeLinkText; // Expose utils & helpers for easy acces from plugins /** * MarkdownIt#utils -> utils * * Assorted utility functions, useful to write plugins. See details * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.js). **/ this.utils = utils; /** * MarkdownIt#helpers -> helpers * * Link components parser functions, useful to write plugins. See details * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers). **/ this.helpers = utils.assign({}, helpers); this.options = {}; this.configure(presetName); if (options) { this.set(options); } }
[ "function", "MarkdownIt", "(", "presetName", ",", "options", ")", "{", "if", "(", "!", "(", "this", "instanceof", "MarkdownIt", ")", ")", "{", "return", "new", "MarkdownIt", "(", "presetName", ",", "options", ")", ";", "}", "if", "(", "!", "options", "...
class MarkdownIt Main parser/renderer class. ##### Usage ```javascript // node.js, "classic" way: var MarkdownIt = require('markdown-it'), md = new MarkdownIt(); var result = md.render('# markdown-it rulezz!'); // node.js, the same, but with sugar: var md = require('markdown-it')(); var result = md.render('# markdown-it rulezz!'); // browser without AMD, added to "window" on script load // Note, there are no dash. var md = window.markdownit(); var result = md.render('# markdown-it rulezz!'); ``` Single line rendering, without paragraph wrap: ```javascript var md = require('markdown-it')(); var result = md.renderInline('__markdown-it__ rulezz!'); ``` new MarkdownIt([presetName, options]) - presetName (String): optional, `commonmark` / `zero` - options (Object) Creates parser instanse with given config. Can be called without `new`. ##### presetName MarkdownIt provides named presets as a convenience to quickly enable/disable active syntax rules and options for common use cases. - ["commonmark"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.js) - configures parser to strict [CommonMark](http://commonmark.org/) mode. - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.js) - similar to GFM, used when no preset name given. Enables all available rules, but still without html, typographer & autolinker. - ["zero"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.js) - all rules disabled. Useful to quickly setup your config via `.enable()`. For example, when you need only `bold` and `italic` markup and nothing else. ##### options: - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful! That's not safe! You may need external sanitizer to protect output from XSS. It's better to extend features via plugins, instead of enabling HTML. - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags (`<br />`). This is needed only for full CommonMark compatibility. In real world you will need HTML output. - __breaks__ - `false`. Set `true` to convert `\n` in paragraphs into `<br>`. - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks. Can be useful for external highlighters. - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links. - __typographer__ - `false`. Set `true` to enable [some language-neutral replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js) + quotes beautification (smartquotes). - __quotes__ - `“”‘’`, String or Array. Double + single quotes replacement pairs, when typographer enabled and smartquotes on. For example, you can use `'«»„“'` for Russian, `'„“‚‘'` for German, and `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp). - __highlight__ - `null`. Highlighter function for fenced code blocks. Highlighter `function (str, lang)` should return escaped HTML. It can also return empty string if the source was not changed and should be escaped externaly. If result starts with <pre... internal wrapper is skipped. ##### Example ```javascript // commonmark mode var md = require('markdown-it')('commonmark'); // default mode var md = require('markdown-it')(); // enable everything var md = require('markdown-it')({ html: true, linkify: true, typographer: true }); ``` ##### Syntax highlighting ```js var hljs = require('highlight.js') // https://highlightjs.org/ var md = require('markdown-it')({ highlight: function (str, lang) { if (lang && hljs.getLanguage(lang)) { try { return hljs.highlight(lang, str, true).value; } catch (__) {} } return ''; // use external default escaping } }); ``` Or with full wrapper override (if you need assign class to `<pre>`): ```javascript var hljs = require('highlight.js') // https://highlightjs.org/ // Actual default values var md = require('markdown-it')({ highlight: function (str, lang) { if (lang && hljs.getLanguage(lang)) { try { return '<pre class="hljs"><code>' + hljs.highlight(lang, str, true).value + '</code></pre>'; } catch (__) {} } return '<pre class="hljs"><code>' + md.utils.escapeHtml(str) + '</code></pre>'; } }); ```
[ "class", "MarkdownIt" ]
ba6830ba13fb92953a91fb90318964ccd15b82c4
https://github.com/markdown-it/markdown-it/blob/ba6830ba13fb92953a91fb90318964ccd15b82c4/lib/index.js#L221-L348
train
MarkdownIt constructor.
[ 30522, 3853, 2928, 7698, 4183, 1006, 3653, 13462, 18442, 1010, 7047, 1007, 1063, 30524, 1065, 2065, 1006, 999, 7047, 1007, 1063, 2065, 1006, 999, 21183, 12146, 1012, 26354, 18886, 3070, 1006, 3653, 13462, 18442, 1007, 1007, 1063, 7047, 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...
MithrilJS/mithril.js
mithril.js
makeLisIndices
function makeLisIndices(a) { var p = a.slice() var result = [] result.push(0) var u var v for (var i = 0, il = a.length; i < il; ++i) { if (a[i] === -1) { continue } var j = result[result.length - 1] if (a[j] < a[i]) { p[i] = j result.push(i) continue } u = 0 v = result.length - 1 while (u < v) { var c = ((u + v) / 2) | 0 // eslint-disable-line no-bitwise if (a[result[c]] < a[i]) { u = c + 1 } else { v = c } } if (a[i] < a[result[u]]) { if (u > 0) { p[i] = result[u - 1] } result[u] = i } } u = result.length v = result[u - 1] while (u-- > 0) { result[u] = v v = p[v] } return result }
javascript
function makeLisIndices(a) { var p = a.slice() var result = [] result.push(0) var u var v for (var i = 0, il = a.length; i < il; ++i) { if (a[i] === -1) { continue } var j = result[result.length - 1] if (a[j] < a[i]) { p[i] = j result.push(i) continue } u = 0 v = result.length - 1 while (u < v) { var c = ((u + v) / 2) | 0 // eslint-disable-line no-bitwise if (a[result[c]] < a[i]) { u = c + 1 } else { v = c } } if (a[i] < a[result[u]]) { if (u > 0) { p[i] = result[u - 1] } result[u] = i } } u = result.length v = result[u - 1] while (u-- > 0) { result[u] = v v = p[v] } return result }
[ "function", "makeLisIndices", "(", "a", ")", "{", "var", "p", "=", "a", ".", "slice", "(", ")", "var", "result", "=", "[", "]", "result", ".", "push", "(", "0", ")", "var", "u", "var", "v", "for", "(", "var", "i", "=", "0", ",", "il", "=", ...
Lifted from ivi https://github.com/ivijs/ivi/ takes a list of unique numbers (-1 is special and can occur multiple times) and returns an array with the indices of the items that are part of the longest increasing subsequece
[ "Lifted", "from", "ivi", "https", ":", "//", "github", ".", "com", "/", "ivijs", "/", "ivi", "/", "takes", "a", "list", "of", "unique", "numbers", "(", "-", "1", "is", "special", "and", "can", "occur", "multiple", "times", ")", "and", "returns", "an"...
6d36fe09d129928c6b460720e08d9ed321fcd62b
https://github.com/MithrilJS/mithril.js/blob/6d36fe09d129928c6b460720e08d9ed321fcd62b/mithril.js#L974-L1015
train
Creates an array of indices for the given array.
[ 30522, 3853, 2191, 6856, 22254, 23522, 1006, 1037, 1007, 1063, 13075, 1052, 1027, 1037, 1012, 14704, 1006, 1007, 13075, 2765, 1027, 1031, 1033, 2765, 1012, 5245, 1006, 1014, 1007, 13075, 1057, 13075, 1058, 2005, 1006, 13075, 1045, 1027, 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...
shipshapecode/shepherd
src/js/utils/dom.js
getElementForStep
function getElementForStep(step) { const { options: { attachTo } } = step; if (!attachTo) { return null; } const type = typeof attachTo; let element; if (type === 'string') { element = getElementFromString(attachTo); } else if (type === 'object') { element = getElementFromObject(attachTo); } else { /* istanbul ignore next: cannot test undefined attachTo, but it does work! */ element = null; } return element; }
javascript
function getElementForStep(step) { const { options: { attachTo } } = step; if (!attachTo) { return null; } const type = typeof attachTo; let element; if (type === 'string') { element = getElementFromString(attachTo); } else if (type === 'object') { element = getElementFromObject(attachTo); } else { /* istanbul ignore next: cannot test undefined attachTo, but it does work! */ element = null; } return element; }
[ "function", "getElementForStep", "(", "step", ")", "{", "const", "{", "options", ":", "{", "attachTo", "}", "}", "=", "step", ";", "if", "(", "!", "attachTo", ")", "{", "return", "null", ";", "}", "const", "type", "=", "typeof", "attachTo", ";", "let...
Return the element for a step @method getElementForStep @param step step the step to get an element for @returns {Element} the element for this step @private
[ "Return", "the", "element", "for", "a", "step" ]
0cb1c63fb07b58796358f6d33da5f6405e2b05f4
https://github.com/shipshapecode/shepherd/blob/0cb1c63fb07b58796358f6d33da5f6405e2b05f4/src/js/utils/dom.js#L40-L60
train
Get element for step
[ 30522, 3853, 2131, 12260, 3672, 29278, 13473, 2361, 1006, 3357, 1007, 1063, 9530, 3367, 1063, 7047, 1024, 1063, 22476, 3406, 1065, 1065, 1027, 3357, 1025, 2065, 1006, 999, 22476, 3406, 1007, 1063, 2709, 19701, 1025, 1065, 9530, 3367, 2828, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/node/FindInFilesDomain.js
init
function init(domainManager) { if (!domainManager.hasDomain("FindInFiles")) { domainManager.registerDomain("FindInFiles", {major: 0, minor: 1}); } _domainManager = domainManager; domainManager.registerCommand( "FindInFiles", // domain name "doSearch", // command name doSearch, // command handler function false, // this command is synchronous in Node "Searches in project files and returns matches", [{name: "searchObject", // parameters type: "object", description: "Object containing search data"}], [{name: "searchResults", // return values type: "object", description: "Object containing results of the search"}] ); domainManager.registerCommand( "FindInFiles", // domain name "nextPage", // command name getNextPage, // command handler function false, // this command is synchronous in Node "get the next page of reults", [], [{name: "searchResults", // return values type: "object", description: "Object containing results of the search"}] ); domainManager.registerCommand( "FindInFiles", // domain name "getAllResults", // command name getAllResults, // command handler function false, // this command is synchronous in Node "get the next page of reults", [], [{name: "searchResults", // return values type: "object", description: "Object containing all results of the search"}] ); domainManager.registerCommand( "FindInFiles", // domain name "collapseResults", // command name setCollapseResults, // command handler function false, // this command is synchronous in Node "get the next page of reults", [{name: "collapse", // return values type: "boolean", description: "true to collapse"}], [] ); domainManager.registerCommand( "FindInFiles", // domain name "filesChanged", // command name addFilesToCache, // command handler function false, // this command is synchronous in Node "files in the project has been changed, update cache", [{name: "updateObject", // parameters type: "object", description: "Object containing list of changed files"}], [] ); domainManager.registerCommand( "FindInFiles", // domain name "documentChanged", // command name documentChanged, // command handler function false, // this command is synchronous in Node "informs that the document changed and updates the cache", [{name: "updateObject", // parameters type: "object", description: "update with the contents of the object"}], [] ); domainManager.registerCommand( "FindInFiles", // domain name "filesRemoved", // command name removeFilesFromCache, // command handler function false, // this command is synchronous in Node "Searches in project files and returns matches", [{name: "updateObject", // parameters type: "object", description: "Object containing list of removed files"}], [] ); domainManager.registerCommand( "FindInFiles", // domain name "initCache", // command name initCache, // command handler function false, // this command is synchronous in Node "Caches the project for find in files in node", [{name: "fileList", // parameters type: "Array", description: "List of all project files - Path only"}], [] ); domainManager.registerEvent( "FindInFiles", // domain name "crawlComplete", // event name [ { name: "numFiles", type: "number", description: "number of files cached" }, { name: "cacheSize", type: "number", description: "The size of the file cache epressesd as string length of files" } ] ); setTimeout(fileCrawler, 5000); }
javascript
function init(domainManager) { if (!domainManager.hasDomain("FindInFiles")) { domainManager.registerDomain("FindInFiles", {major: 0, minor: 1}); } _domainManager = domainManager; domainManager.registerCommand( "FindInFiles", // domain name "doSearch", // command name doSearch, // command handler function false, // this command is synchronous in Node "Searches in project files and returns matches", [{name: "searchObject", // parameters type: "object", description: "Object containing search data"}], [{name: "searchResults", // return values type: "object", description: "Object containing results of the search"}] ); domainManager.registerCommand( "FindInFiles", // domain name "nextPage", // command name getNextPage, // command handler function false, // this command is synchronous in Node "get the next page of reults", [], [{name: "searchResults", // return values type: "object", description: "Object containing results of the search"}] ); domainManager.registerCommand( "FindInFiles", // domain name "getAllResults", // command name getAllResults, // command handler function false, // this command is synchronous in Node "get the next page of reults", [], [{name: "searchResults", // return values type: "object", description: "Object containing all results of the search"}] ); domainManager.registerCommand( "FindInFiles", // domain name "collapseResults", // command name setCollapseResults, // command handler function false, // this command is synchronous in Node "get the next page of reults", [{name: "collapse", // return values type: "boolean", description: "true to collapse"}], [] ); domainManager.registerCommand( "FindInFiles", // domain name "filesChanged", // command name addFilesToCache, // command handler function false, // this command is synchronous in Node "files in the project has been changed, update cache", [{name: "updateObject", // parameters type: "object", description: "Object containing list of changed files"}], [] ); domainManager.registerCommand( "FindInFiles", // domain name "documentChanged", // command name documentChanged, // command handler function false, // this command is synchronous in Node "informs that the document changed and updates the cache", [{name: "updateObject", // parameters type: "object", description: "update with the contents of the object"}], [] ); domainManager.registerCommand( "FindInFiles", // domain name "filesRemoved", // command name removeFilesFromCache, // command handler function false, // this command is synchronous in Node "Searches in project files and returns matches", [{name: "updateObject", // parameters type: "object", description: "Object containing list of removed files"}], [] ); domainManager.registerCommand( "FindInFiles", // domain name "initCache", // command name initCache, // command handler function false, // this command is synchronous in Node "Caches the project for find in files in node", [{name: "fileList", // parameters type: "Array", description: "List of all project files - Path only"}], [] ); domainManager.registerEvent( "FindInFiles", // domain name "crawlComplete", // event name [ { name: "numFiles", type: "number", description: "number of files cached" }, { name: "cacheSize", type: "number", description: "The size of the file cache epressesd as string length of files" } ] ); setTimeout(fileCrawler, 5000); }
[ "function", "init", "(", "domainManager", ")", "{", "if", "(", "!", "domainManager", ".", "hasDomain", "(", "\"FindInFiles\"", ")", ")", "{", "domainManager", ".", "registerDomain", "(", "\"FindInFiles\"", ",", "{", "major", ":", "0", ",", "minor", ":", "1...
Initialize the test domain with commands and events related to find in files. @param {DomainManager} domainManager The DomainManager for the find in files domain "FindInFiles"
[ "Initialize", "the", "test", "domain", "with", "commands", "and", "events", "related", "to", "find", "in", "files", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/node/FindInFilesDomain.js#L571-L683
train
Initializes the node domain manager
[ 30522, 3853, 1999, 4183, 1006, 5884, 24805, 4590, 1007, 1063, 2065, 1006, 999, 5884, 24805, 4590, 1012, 2038, 9527, 8113, 1006, 1000, 2424, 2378, 8873, 4244, 1000, 1007, 1007, 1063, 5884, 24805, 4590, 1012, 4236, 9527, 8113, 1006, 1000, 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...
eslint/eslint
lib/cli-engine.js
createRuleDeprecationWarnings
function createRuleDeprecationWarnings(usedRules, loadedRules) { const usedDeprecatedRules = []; usedRules.forEach(name => { const loadedRule = loadedRules.get(name); if (loadedRule && loadedRule.meta && loadedRule.meta.deprecated) { const deprecatedRule = { ruleId: name }; const replacedBy = lodash.get(loadedRule, "meta.replacedBy", []); if (replacedBy.every(newRule => lodash.isString(newRule))) { deprecatedRule.replacedBy = replacedBy; } usedDeprecatedRules.push(deprecatedRule); } }); return usedDeprecatedRules; }
javascript
function createRuleDeprecationWarnings(usedRules, loadedRules) { const usedDeprecatedRules = []; usedRules.forEach(name => { const loadedRule = loadedRules.get(name); if (loadedRule && loadedRule.meta && loadedRule.meta.deprecated) { const deprecatedRule = { ruleId: name }; const replacedBy = lodash.get(loadedRule, "meta.replacedBy", []); if (replacedBy.every(newRule => lodash.isString(newRule))) { deprecatedRule.replacedBy = replacedBy; } usedDeprecatedRules.push(deprecatedRule); } }); return usedDeprecatedRules; }
[ "function", "createRuleDeprecationWarnings", "(", "usedRules", ",", "loadedRules", ")", "{", "const", "usedDeprecatedRules", "=", "[", "]", ";", "usedRules", ".", "forEach", "(", "name", "=>", "{", "const", "loadedRule", "=", "loadedRules", ".", "get", "(", "n...
Produces rule warnings (i.e. deprecation) from configured rules @param {(Array<string>|Set<string>)} usedRules - Rules configured @param {Map} loadedRules - Map of loaded rules @returns {Array<Object>} Contains rule warnings @private
[ "Produces", "rule", "warnings", "(", "i", ".", "e", ".", "deprecation", ")", "from", "configured", "rules" ]
bc0819c94aad14f7fad3cbc2338ea15658b0f272
https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/cli-engine.js#L304-L323
train
Create deprecated rules
[ 30522, 3853, 3443, 6820, 3709, 13699, 2890, 10719, 9028, 5582, 2015, 1006, 2109, 6820, 4244, 1010, 8209, 6820, 4244, 1007, 1063, 9530, 3367, 2109, 3207, 28139, 12921, 6820, 4244, 1027, 1031, 1033, 1025, 2109, 6820, 4244, 1012, 18921, 6776, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
testing-library/dom-testing-library
src/query-helpers.js
makeSingleQuery
function makeSingleQuery(allQuery, getMultipleError) { return (container, ...args) => { const els = allQuery(container, ...args) if (els.length > 1) { throw getMultipleElementsFoundError( getMultipleError(container, ...args), container, ) } return els[0] || null } }
javascript
function makeSingleQuery(allQuery, getMultipleError) { return (container, ...args) => { const els = allQuery(container, ...args) if (els.length > 1) { throw getMultipleElementsFoundError( getMultipleError(container, ...args), container, ) } return els[0] || null } }
[ "function", "makeSingleQuery", "(", "allQuery", ",", "getMultipleError", ")", "{", "return", "(", "container", ",", "...", "args", ")", "=>", "{", "const", "els", "=", "allQuery", "(", "container", ",", "...", "args", ")", "if", "(", "els", ".", "length"...
this accepts a query function and returns a function which throws an error if more than one elements is returned, otherwise it returns the first element or null
[ "this", "accepts", "a", "query", "function", "and", "returns", "a", "function", "which", "throws", "an", "error", "if", "more", "than", "one", "elements", "is", "returned", "otherwise", "it", "returns", "the", "first", "element", "or", "null" ]
fcb2cbcffb7aff6ecff3be8731168c86eee82ce1
https://github.com/testing-library/dom-testing-library/blob/fcb2cbcffb7aff6ecff3be8731168c86eee82ce1/src/query-helpers.js#L68-L79
train
Returns a function that returns a single element if there are multiple elements
[ 30522, 3853, 3084, 2075, 2571, 4226, 2854, 1006, 2035, 4226, 2854, 1010, 2131, 12274, 7096, 11514, 10559, 18933, 2099, 1007, 1063, 2709, 1006, 11661, 1010, 1012, 1012, 1012, 12098, 5620, 1007, 1027, 1028, 1063, 9530, 3367, 3449, 2015, 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...
SheetJS/js-xlsx
xlsx.js
write_Blxf
function write_Blxf(data, o) { if(!o) o = new_buf(10); o.write_shift(1, 0); /* dg */ o.write_shift(1, 0); o.write_shift(4, 0); /* color */ o.write_shift(4, 0); /* color */ return o; }
javascript
function write_Blxf(data, o) { if(!o) o = new_buf(10); o.write_shift(1, 0); /* dg */ o.write_shift(1, 0); o.write_shift(4, 0); /* color */ o.write_shift(4, 0); /* color */ return o; }
[ "function", "write_Blxf", "(", "data", ",", "o", ")", "{", "if", "(", "!", "o", ")", "o", "=", "new_buf", "(", "10", ")", ";", "o", ".", "write_shift", "(", "1", ",", "0", ")", ";", "/* dg */", "o", ".", "write_shift", "(", "1", ",", "0", ")"...
/* [MS-XLSB] 2.5.4 Blxf TODO
[ "/", "*", "[", "MS", "-", "XLSB", "]", "2", ".", "5", ".", "4", "Blxf", "TODO" ]
9a6d8a1d3d80c78dad5201fb389316f935279cdc
https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L9181-L9188
train
write blxf
[ 30522, 3853, 4339, 1035, 1038, 2140, 2595, 2546, 1006, 2951, 1010, 1051, 1007, 1063, 2065, 1006, 999, 1051, 1007, 1051, 1027, 2047, 1035, 20934, 2546, 1006, 2184, 1007, 1025, 1051, 1012, 4339, 1035, 5670, 1006, 1015, 1010, 1014, 1007, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/extensions/default/JavaScriptRefactoring/ExtractToVariable.js
findAllExpressions
function findAllExpressions(parentBlockStatement, expn, text) { var doc = session.editor.document, obj = {}, expns = []; // find all references of the expression obj[expn.type] = function(node) { if (text === doc.getText().substr(node.start, node.end - node.start)) { expns.push(node); } }; ASTWalker.simple(parentBlockStatement, obj); return expns; }
javascript
function findAllExpressions(parentBlockStatement, expn, text) { var doc = session.editor.document, obj = {}, expns = []; // find all references of the expression obj[expn.type] = function(node) { if (text === doc.getText().substr(node.start, node.end - node.start)) { expns.push(node); } }; ASTWalker.simple(parentBlockStatement, obj); return expns; }
[ "function", "findAllExpressions", "(", "parentBlockStatement", ",", "expn", ",", "text", ")", "{", "var", "doc", "=", "session", ".", "editor", ".", "document", ",", "obj", "=", "{", "}", ",", "expns", "=", "[", "]", ";", "// find all references of the expre...
Find all expressions in the parentBlockStatement that are same as expn @param {!ASTNode} parentBlockStatement @param {!ASTNode} expn @param {!string} text - text of the expression @return {!Array.<ASTNode>}
[ "Find", "all", "expressions", "in", "the", "parentBlockStatement", "that", "are", "same", "as", "expn" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptRefactoring/ExtractToVariable.js#L106-L120
train
find all expressions in the block
[ 30522, 3853, 2424, 24164, 2595, 20110, 8496, 1006, 6687, 23467, 9153, 18532, 4765, 1010, 4654, 2361, 2078, 1010, 3793, 1007, 1063, 13075, 9986, 1027, 5219, 1012, 3559, 1012, 6254, 1010, 27885, 3501, 1027, 1063, 1065, 1010, 4654, 2361, 3619,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/PreferencesManager.js
_adjustScopeOrderForProject
function _adjustScopeOrderForProject(scopeOrder, includeProject) { var hasProject = scopeOrder.indexOf("project") > -1; if (hasProject === includeProject) { return scopeOrder; } var newScopeOrder; if (includeProject) { var before = scopeOrder.indexOf("user"); if (before === -1) { before = scopeOrder.length - 2; } newScopeOrder = _.take(scopeOrder, before); newScopeOrder.push("project"); newScopeOrder.push.apply(newScopeOrder, _.drop(scopeOrder, before)); } else { newScopeOrder = _.without(scopeOrder, "project"); } return newScopeOrder; }
javascript
function _adjustScopeOrderForProject(scopeOrder, includeProject) { var hasProject = scopeOrder.indexOf("project") > -1; if (hasProject === includeProject) { return scopeOrder; } var newScopeOrder; if (includeProject) { var before = scopeOrder.indexOf("user"); if (before === -1) { before = scopeOrder.length - 2; } newScopeOrder = _.take(scopeOrder, before); newScopeOrder.push("project"); newScopeOrder.push.apply(newScopeOrder, _.drop(scopeOrder, before)); } else { newScopeOrder = _.without(scopeOrder, "project"); } return newScopeOrder; }
[ "function", "_adjustScopeOrderForProject", "(", "scopeOrder", ",", "includeProject", ")", "{", "var", "hasProject", "=", "scopeOrder", ".", "indexOf", "(", "\"project\"", ")", ">", "-", "1", ";", "if", "(", "hasProject", "===", "includeProject", ")", "{", "ret...
@private Adjusts scopeOrder to have the project Scope if necessary. Returns a new array if changes are needed, otherwise returns the original array. @param {Array.<string>} scopeOrder initial scopeOrder @param {boolean} includeProject Whether the project Scope should be included @return {Array.<string>} array with or without project Scope as needed.
[ "@private" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesManager.js#L157-L178
train
Adjust scopeOrder for project
[ 30522, 3853, 1035, 14171, 26127, 8551, 2121, 29278, 21572, 20614, 1006, 9531, 8551, 2121, 1010, 2421, 21572, 20614, 1007, 1063, 13075, 2038, 21572, 20614, 1027, 9531, 8551, 2121, 1012, 5950, 11253, 1006, 1000, 2622, 1000, 1007, 1028, 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...
vuejs/vuepress
packages/@vuepress/core/lib/node/dev/index.js
resolveHost
function resolveHost (host) { const defaultHost = '0.0.0.0' host = host || defaultHost const displayHost = host === defaultHost ? 'localhost' : host return { displayHost, host } }
javascript
function resolveHost (host) { const defaultHost = '0.0.0.0' host = host || defaultHost const displayHost = host === defaultHost ? 'localhost' : host return { displayHost, host } }
[ "function", "resolveHost", "(", "host", ")", "{", "const", "defaultHost", "=", "'0.0.0.0'", "host", "=", "host", "||", "defaultHost", "const", "displayHost", "=", "host", "===", "defaultHost", "?", "'localhost'", ":", "host", "return", "{", "displayHost", ",",...
Resolve host. @param {string} host user's host @returns {{displayHost: string, host: string}}
[ "Resolve", "host", "." ]
15784acc0cf2e87de3c147895b2c3977b0195d78
https://github.com/vuejs/vuepress/blob/15784acc0cf2e87de3c147895b2c3977b0195d78/packages/@vuepress/core/lib/node/dev/index.js#L268-L278
train
Resolve host to a node - network
[ 30522, 3853, 10663, 15006, 2102, 1006, 3677, 1007, 1063, 9530, 3367, 12398, 15006, 2102, 1027, 1005, 1014, 1012, 1014, 1012, 1014, 1012, 1014, 1005, 3677, 1027, 3677, 1064, 1064, 12398, 15006, 2102, 9530, 3367, 4653, 15006, 2102, 1027, 3677...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
goldfire/howler.js
examples/player/player.js
function(per) { var self = this; // Get the Howl we want to manipulate. var sound = self.playlist[self.index].howl; // Convert the percent into a seek position. if (sound.playing()) { sound.seek(sound.duration() * per); } }
javascript
function(per) { var self = this; // Get the Howl we want to manipulate. var sound = self.playlist[self.index].howl; // Convert the percent into a seek position. if (sound.playing()) { sound.seek(sound.duration() * per); } }
[ "function", "(", "per", ")", "{", "var", "self", "=", "this", ";", "// Get the Howl we want to manipulate.", "var", "sound", "=", "self", ".", "playlist", "[", "self", ".", "index", "]", ".", "howl", ";", "// Convert the percent into a seek position.", "if", "("...
Seek to a new position in the currently playing track. @param {Number} per Percentage through the song to skip.
[ "Seek", "to", "a", "new", "position", "in", "the", "currently", "playing", "track", "." ]
030db918dd8ce640afd57e172418472497e8f113
https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/examples/player/player.js#L201-L211
train
Set the current seek position
[ 30522, 3853, 1006, 2566, 1007, 1063, 13075, 2969, 1027, 2023, 1025, 1013, 1013, 2131, 1996, 22912, 2057, 2215, 2000, 17708, 1012, 13075, 2614, 1027, 2969, 1012, 2377, 9863, 1031, 2969, 1012, 5950, 1033, 1012, 22912, 1025, 1013, 1013, 10463,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
ramda/ramda
source/internal/_objectIs.js
_objectIs
function _objectIs(a, b) { // SameValue algorithm if (a === b) { // Steps 1-5, 7-10 // Steps 6.b-6.e: +0 != -0 return a !== 0 || 1 / a === 1 / b; } else { // Step 6.a: NaN == NaN return a !== a && b !== b; } }
javascript
function _objectIs(a, b) { // SameValue algorithm if (a === b) { // Steps 1-5, 7-10 // Steps 6.b-6.e: +0 != -0 return a !== 0 || 1 / a === 1 / b; } else { // Step 6.a: NaN == NaN return a !== a && b !== b; } }
[ "function", "_objectIs", "(", "a", ",", "b", ")", "{", "// SameValue algorithm", "if", "(", "a", "===", "b", ")", "{", "// Steps 1-5, 7-10", "// Steps 6.b-6.e: +0 != -0", "return", "a", "!==", "0", "||", "1", "/", "a", "===", "1", "/", "b", ";", "}", "...
Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
[ "Based", "on", "https", ":", "//", "developer", ".", "mozilla", ".", "org", "/", "en", "-", "US", "/", "docs", "/", "Web", "/", "JavaScript", "/", "Reference", "/", "Global_Objects", "/", "Object", "/", "is" ]
072d417a345e7087a95466a9825d43b6ca3a4941
https://github.com/ramda/ramda/blob/072d417a345e7087a95466a9825d43b6ca3a4941/source/internal/_objectIs.js#L2-L11
train
Check if an object is a object of the same type
[ 30522, 3853, 1035, 4874, 2483, 1006, 1037, 1010, 1038, 1007, 1063, 1013, 1013, 2168, 10175, 5657, 9896, 2065, 1006, 1037, 1027, 1027, 1027, 1038, 1007, 1063, 1013, 1013, 4084, 1015, 1011, 1019, 1010, 1021, 1011, 2184, 1013, 1013, 4084, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/model/odata/ODataTreeBindingFlat.js
function (oNode, bIgnore, oParent, iPositionInParent, oIgnoreRemoveForNode) { // ignore node if it was already mapped or is removed (except if it was reinserted, denoted by oIgnoreRemoveForNode) if (!bIgnore) { if (!oNode.nodeState.removed || oIgnoreRemoveForNode == oNode) { fnMap(oNode, oRecursionBreaker, "positionInParent", iPositionInParent, oParent); if (oRecursionBreaker.broken) { return; } } } fnCheckNodeForAddedSubtrees(oNode); if (oRecursionBreaker.broken) { return; } // if the node also has children AND is expanded, dig deeper if (oNode && oNode.children && oNode.nodeState.expanded) { for (var i = 0; i < oNode.children.length; i++) { var oChildNode = oNode.children[i]; // Make sure that the level of all child nodes are adapted to the parent level, // this is necessary if the parent node was placed in a different leveled subtree. // Ignore removed nodes, which are not re-inserted. // Re-inserted deep nodes will be regarded in fnTraverseAddedSubtree. if (oChildNode && !oChildNode.nodeState.removed && !oChildNode.nodeState.reinserted) { oChildNode.level = oNode.level + 1; } // only dive deeper if we have a gap (entry which has to be loaded) or a defined node is NOT removed if (oChildNode && !oChildNode.nodeState.removed) { fnTraverseDeepSubtree(oChildNode, false, oNode, i, oIgnoreRemoveForNode); } else if (!oChildNode) { fnMap(oChildNode, oRecursionBreaker, "positionInParent", i, oNode); } if (oRecursionBreaker.broken) { return; } } } }
javascript
function (oNode, bIgnore, oParent, iPositionInParent, oIgnoreRemoveForNode) { // ignore node if it was already mapped or is removed (except if it was reinserted, denoted by oIgnoreRemoveForNode) if (!bIgnore) { if (!oNode.nodeState.removed || oIgnoreRemoveForNode == oNode) { fnMap(oNode, oRecursionBreaker, "positionInParent", iPositionInParent, oParent); if (oRecursionBreaker.broken) { return; } } } fnCheckNodeForAddedSubtrees(oNode); if (oRecursionBreaker.broken) { return; } // if the node also has children AND is expanded, dig deeper if (oNode && oNode.children && oNode.nodeState.expanded) { for (var i = 0; i < oNode.children.length; i++) { var oChildNode = oNode.children[i]; // Make sure that the level of all child nodes are adapted to the parent level, // this is necessary if the parent node was placed in a different leveled subtree. // Ignore removed nodes, which are not re-inserted. // Re-inserted deep nodes will be regarded in fnTraverseAddedSubtree. if (oChildNode && !oChildNode.nodeState.removed && !oChildNode.nodeState.reinserted) { oChildNode.level = oNode.level + 1; } // only dive deeper if we have a gap (entry which has to be loaded) or a defined node is NOT removed if (oChildNode && !oChildNode.nodeState.removed) { fnTraverseDeepSubtree(oChildNode, false, oNode, i, oIgnoreRemoveForNode); } else if (!oChildNode) { fnMap(oChildNode, oRecursionBreaker, "positionInParent", i, oNode); } if (oRecursionBreaker.broken) { return; } } } }
[ "function", "(", "oNode", ",", "bIgnore", ",", "oParent", ",", "iPositionInParent", ",", "oIgnoreRemoveForNode", ")", "{", "// ignore node if it was already mapped or is removed (except if it was reinserted, denoted by oIgnoreRemoveForNode)", "if", "(", "!", "bIgnore", ")", "{"...
Recursive Tree Traversal @param {object} oNode the current node @param {boolean} bIgnore a flag to indicate if the node should be mapped @param {object} oParent the parent node of oNode @param {int} iPositionInParent the position of oNode in the children-array of oParent
[ "Recursive", "Tree", "Traversal" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/ODataTreeBindingFlat.js#L354-L391
train
Traverse the tree
[ 30522, 3853, 1006, 21058, 3207, 1010, 2502, 12131, 2063, 1010, 6728, 12069, 3372, 1010, 12997, 19234, 2378, 19362, 4765, 1010, 1051, 23773, 5686, 28578, 21818, 29278, 3630, 3207, 1007, 1063, 1013, 1013, 8568, 13045, 2065, 2009, 2001, 2525, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/core/Manifest.js
processObject
function processObject(oObject, fnCallback) { for (var sKey in oObject) { if (!oObject.hasOwnProperty(sKey)) { continue; } var vValue = oObject[sKey]; switch (typeof vValue) { case "object": // ignore null objects if (vValue) { processObject(vValue, fnCallback); } break; case "string": fnCallback(oObject, sKey, vValue); break; default: // do nothing in case of other types } } }
javascript
function processObject(oObject, fnCallback) { for (var sKey in oObject) { if (!oObject.hasOwnProperty(sKey)) { continue; } var vValue = oObject[sKey]; switch (typeof vValue) { case "object": // ignore null objects if (vValue) { processObject(vValue, fnCallback); } break; case "string": fnCallback(oObject, sKey, vValue); break; default: // do nothing in case of other types } } }
[ "function", "processObject", "(", "oObject", ",", "fnCallback", ")", "{", "for", "(", "var", "sKey", "in", "oObject", ")", "{", "if", "(", "!", "oObject", ".", "hasOwnProperty", "(", "sKey", ")", ")", "{", "continue", ";", "}", "var", "vValue", "=", ...
Utility function to process strings in an object/array recursively @param {object/Array} oObject Object or array that will be processed @param {function} fnCallback function(oObject, sKey, sValue) to call for all strings. Use "oObject[sKey] = X" to change the value.
[ "Utility", "function", "to", "process", "strings", "in", "an", "object", "/", "array", "recursively" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Manifest.js#L54-L74
train
processObject - process an object
[ 30522, 3853, 2832, 16429, 20614, 1006, 1051, 16429, 20614, 1010, 1042, 20909, 3363, 5963, 1007, 1063, 2005, 1006, 13075, 15315, 3240, 1999, 1051, 16429, 20614, 1007, 1063, 2065, 1006, 999, 1051, 16429, 20614, 1012, 2038, 12384, 21572, 4842, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
NervJS/taro
packages/taro-h5/src/api/createSelectorQuery/index.js
queryBat
function queryBat (queue, cb) { const res = [] queue.forEach(item => { const { selector, single, fields, component } = item // selector 的容器节点 /* eslint-disable */ const container = ( component !== null ? (Nerv.findDOMNode(component) || document) : document ) /* eslint-enable */ // 特殊处理 ---- 选自己 let selectSelf = false if (container !== document) { const $nodeList = container.parentNode.querySelectorAll(selector) for (let i = 0, len = $nodeList.length; i < len; ++i) { if (container === $nodeList[i]) { selectSelf = true break } } } if (single) { const el = selectSelf === true ? container : container.querySelector(selector) res.push(filter(fields, el, selector)) } else { const $children = container.querySelectorAll(selector) const children = [] selectSelf === true && children.push(container) for (let i = 0, len = $children.length; i < len; ++i) { children.push($children[i]) } res.push(children.map(dom => filter(fields, dom))) } }) cb(res) }
javascript
function queryBat (queue, cb) { const res = [] queue.forEach(item => { const { selector, single, fields, component } = item // selector 的容器节点 /* eslint-disable */ const container = ( component !== null ? (Nerv.findDOMNode(component) || document) : document ) /* eslint-enable */ // 特殊处理 ---- 选自己 let selectSelf = false if (container !== document) { const $nodeList = container.parentNode.querySelectorAll(selector) for (let i = 0, len = $nodeList.length; i < len; ++i) { if (container === $nodeList[i]) { selectSelf = true break } } } if (single) { const el = selectSelf === true ? container : container.querySelector(selector) res.push(filter(fields, el, selector)) } else { const $children = container.querySelectorAll(selector) const children = [] selectSelf === true && children.push(container) for (let i = 0, len = $children.length; i < len; ++i) { children.push($children[i]) } res.push(children.map(dom => filter(fields, dom))) } }) cb(res) }
[ "function", "queryBat", "(", "queue", ",", "cb", ")", "{", "const", "res", "=", "[", "]", "queue", ".", "forEach", "(", "item", "=>", "{", "const", "{", "selector", ",", "single", ",", "fields", ",", "component", "}", "=", "item", "// selector 的容器节点", ...
WXML节点信息API @return {Object} SelectorQuery 对象实例
[ "WXML节点信息API" ]
274e76d731d7f158141287e31cbd51f092d472c5
https://github.com/NervJS/taro/blob/274e76d731d7f158141287e31cbd51f092d472c5/packages/taro-h5/src/api/createSelectorQuery/index.js#L7-L47
train
queryBat - query bat
[ 30522, 3853, 23032, 14479, 1006, 24240, 1010, 17324, 1007, 1063, 9530, 3367, 24501, 1027, 1031, 1033, 24240, 1012, 18921, 6776, 1006, 8875, 1027, 1028, 1063, 9530, 3367, 1063, 27000, 1010, 2309, 1010, 4249, 1010, 6922, 1065, 1027, 8875, 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...
eslint/eslint
lib/rules/lines-around-comment.js
isCommentAtBlockEnd
function isCommentAtBlockEnd(token) { return isCommentAtParentEnd(token, "ClassBody") || isCommentAtParentEnd(token, "BlockStatement") || isCommentAtParentEnd(token, "SwitchCase") || isCommentAtParentEnd(token, "SwitchStatement"); }
javascript
function isCommentAtBlockEnd(token) { return isCommentAtParentEnd(token, "ClassBody") || isCommentAtParentEnd(token, "BlockStatement") || isCommentAtParentEnd(token, "SwitchCase") || isCommentAtParentEnd(token, "SwitchStatement"); }
[ "function", "isCommentAtBlockEnd", "(", "token", ")", "{", "return", "isCommentAtParentEnd", "(", "token", ",", "\"ClassBody\"", ")", "||", "isCommentAtParentEnd", "(", "token", ",", "\"BlockStatement\"", ")", "||", "isCommentAtParentEnd", "(", "token", ",", "\"Swit...
Returns whether or not comments are at the block end or not. @param {token} token The Comment token. @returns {boolean} True if the comment is at block end.
[ "Returns", "whether", "or", "not", "comments", "are", "at", "the", "block", "end", "or", "not", "." ]
bc0819c94aad14f7fad3cbc2338ea15658b0f272
https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/lines-around-comment.js#L236-L238
train
Check if comment is at the end of block
[ 30522, 3853, 2003, 9006, 3672, 4017, 23467, 10497, 1006, 19204, 1007, 1063, 2709, 2003, 9006, 3672, 4017, 19362, 15781, 4859, 1006, 19204, 1010, 1000, 2465, 23684, 1000, 1007, 1064, 1064, 2003, 9006, 3672, 4017, 19362, 15781, 4859, 1006, 19...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
postcss/autoprefixer
lib/hacks/grid-utils.js
warnIfGridRowColumnExists
function warnIfGridRowColumnExists (decl, result) { let rule = decl.parent let decls = [] rule.walkDecls(/^grid-(row|column)/, d => { if (!/-end$/.test(d.prop) && !/^span/.test(d.value)) { decls.push(d) } }) if (decls.length > 0) { decls.forEach(d => { d.warn(result, `You already have a grid-area declaration present in the rule. ` + `You should use either grid-area or ${ d.prop }, not both`) }) } return undefined }
javascript
function warnIfGridRowColumnExists (decl, result) { let rule = decl.parent let decls = [] rule.walkDecls(/^grid-(row|column)/, d => { if (!/-end$/.test(d.prop) && !/^span/.test(d.value)) { decls.push(d) } }) if (decls.length > 0) { decls.forEach(d => { d.warn(result, `You already have a grid-area declaration present in the rule. ` + `You should use either grid-area or ${ d.prop }, not both`) }) } return undefined }
[ "function", "warnIfGridRowColumnExists", "(", "decl", ",", "result", ")", "{", "let", "rule", "=", "decl", ".", "parent", "let", "decls", "=", "[", "]", "rule", ".", "walkDecls", "(", "/", "^grid-(row|column)", "/", ",", "d", "=>", "{", "if", "(", "!",...
warn user if both grid-area and grid-(row|column) declarations are present in the same rule @param {Declaration} decl @param {Result} result @return {void}
[ "warn", "user", "if", "both", "grid", "-", "area", "and", "grid", "-", "(", "row|column", ")", "declarations", "are", "present", "in", "the", "same", "rule" ]
24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32
https://github.com/postcss/autoprefixer/blob/24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32/lib/hacks/grid-utils.js#L748-L765
train
Warn if grid - row or grid - column declaration already present in the rule
[ 30522, 3853, 11582, 10128, 16523, 3593, 10524, 25778, 2819, 2638, 9048, 12837, 1006, 11703, 2140, 1010, 2765, 1007, 1063, 2292, 3627, 1027, 11703, 2140, 1012, 6687, 2292, 11703, 4877, 1027, 1031, 1033, 3627, 1012, 3328, 3207, 20464, 2015, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
eslint/eslint
lib/rules/no-native-reassign.js
checkVariable
function checkVariable(variable) { if (variable.writeable === false && exceptions.indexOf(variable.name) === -1) { variable.references.forEach(checkReference); } }
javascript
function checkVariable(variable) { if (variable.writeable === false && exceptions.indexOf(variable.name) === -1) { variable.references.forEach(checkReference); } }
[ "function", "checkVariable", "(", "variable", ")", "{", "if", "(", "variable", ".", "writeable", "===", "false", "&&", "exceptions", ".", "indexOf", "(", "variable", ".", "name", ")", "===", "-", "1", ")", "{", "variable", ".", "references", ".", "forEac...
Reports write references if a given variable is read-only builtin. @param {Variable} variable - A variable to check. @returns {void}
[ "Reports", "write", "references", "if", "a", "given", "variable", "is", "read", "-", "only", "builtin", "." ]
bc0819c94aad14f7fad3cbc2338ea15658b0f272
https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-native-reassign.js#L79-L83
train
Check if variable is writeable
[ 30522, 3853, 4638, 10755, 19210, 1006, 8023, 1007, 1063, 2065, 1006, 8023, 1012, 4339, 3085, 1027, 1027, 1027, 6270, 1004, 1004, 11790, 1012, 5950, 11253, 1006, 8023, 1012, 2171, 1007, 1027, 1027, 1027, 1011, 1015, 1007, 1063, 8023, 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...
getinsomnia/insomnia
packages/insomnia-importers/src/importers/openapi3.js
prepareBody
function prepareBody(endpointSchema) { // request const requestBody = endpointSchema.requestBody || {}; const content = requestBody.content || {}; const mimeTypes = Object.keys(content); const isAvailable = m => mimeTypes.includes(m); const supportedMimeType = SUPPORTED_MIME_TYPES.find(isAvailable); if (supportedMimeType === MIMETYPE_JSON) { const bodyParameter = content[supportedMimeType]; if (bodyParameter == null) { return { mimeType: MIMETYPE_JSON, }; } const example = generateParameterExample(bodyParameter.schema); const text = JSON.stringify(example, null, 2); return { mimeType: MIMETYPE_JSON, text, }; } if (mimeTypes && mimeTypes.length && mimeTypes[0] !== MIMETYPE_LITERALLY_ANYTHING) { return { mimeType: mimeTypes[0] || undefined, }; } else { return {}; } }
javascript
function prepareBody(endpointSchema) { // request const requestBody = endpointSchema.requestBody || {}; const content = requestBody.content || {}; const mimeTypes = Object.keys(content); const isAvailable = m => mimeTypes.includes(m); const supportedMimeType = SUPPORTED_MIME_TYPES.find(isAvailable); if (supportedMimeType === MIMETYPE_JSON) { const bodyParameter = content[supportedMimeType]; if (bodyParameter == null) { return { mimeType: MIMETYPE_JSON, }; } const example = generateParameterExample(bodyParameter.schema); const text = JSON.stringify(example, null, 2); return { mimeType: MIMETYPE_JSON, text, }; } if (mimeTypes && mimeTypes.length && mimeTypes[0] !== MIMETYPE_LITERALLY_ANYTHING) { return { mimeType: mimeTypes[0] || undefined, }; } else { return {}; } }
[ "function", "prepareBody", "(", "endpointSchema", ")", "{", "// request", "const", "requestBody", "=", "endpointSchema", ".", "requestBody", "||", "{", "}", ";", "const", "content", "=", "requestBody", ".", "content", "||", "{", "}", ";", "const", "mimeTypes",...
Imports insomnia request body definitions, including data mock (if available) If multiple types are available, the one for which an example can be generated will be selected first (i.e. application/json) @param {Object} endpointSchema - OpenAPI 3 endpoint schema @return {Object} insomnia request's body definition
[ "Imports", "insomnia", "request", "body", "definitions", "including", "data", "mock", "(", "if", "available", ")" ]
e24ce7f7b41246e700c4b9bdb6b34b6652ad589b
https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-importers/src/importers/openapi3.js#L225-L258
train
Prepare the body of the request
[ 30522, 3853, 7374, 23684, 1006, 2203, 26521, 5403, 2863, 1007, 1063, 1013, 1013, 5227, 9530, 3367, 5227, 23684, 1027, 2203, 26521, 5403, 2863, 1012, 5227, 23684, 1064, 1064, 1063, 1065, 1025, 9530, 3367, 4180, 1027, 5227, 23684, 1012, 4180,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
firebase/firebase-js-sdk
packages/auth/demo/public/script.js
onSendPasswordResetEmail
function onSendPasswordResetEmail() { var email = $('#password-reset-email').val(); auth.sendPasswordResetEmail(email, getActionCodeSettings()).then(function() { alertSuccess('Email sent!'); }, onAuthError); }
javascript
function onSendPasswordResetEmail() { var email = $('#password-reset-email').val(); auth.sendPasswordResetEmail(email, getActionCodeSettings()).then(function() { alertSuccess('Email sent!'); }, onAuthError); }
[ "function", "onSendPasswordResetEmail", "(", ")", "{", "var", "email", "=", "$", "(", "'#password-reset-email'", ")", ".", "val", "(", ")", ";", "auth", ".", "sendPasswordResetEmail", "(", "email", ",", "getActionCodeSettings", "(", ")", ")", ".", "then", "(...
Sends password reset email to the user.
[ "Sends", "password", "reset", "email", "to", "the", "user", "." ]
491598a499813dacc23724de5e237ec220cc560e
https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/auth/demo/public/script.js#L687-L692
train
Send a password reset email
[ 30522, 3853, 2006, 5054, 18927, 12054, 18351, 6072, 12870, 21397, 1006, 1007, 1063, 13075, 10373, 1027, 1002, 1006, 1005, 1001, 20786, 1011, 25141, 1011, 10373, 1005, 1007, 1012, 11748, 1006, 1007, 1025, 8740, 2705, 1012, 4604, 15194, 18351, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
adobe/brackets
src/view/MainViewManager.js
getWorkingSet
function getWorkingSet(paneId) { var result = []; _forEachPaneOrPanes(paneId, function (pane) { var viewList = pane.getViewList(); result = _.union(result, viewList); }); return result; }
javascript
function getWorkingSet(paneId) { var result = []; _forEachPaneOrPanes(paneId, function (pane) { var viewList = pane.getViewList(); result = _.union(result, viewList); }); return result; }
[ "function", "getWorkingSet", "(", "paneId", ")", "{", "var", "result", "=", "[", "]", ";", "_forEachPaneOrPanes", "(", "paneId", ",", "function", "(", "pane", ")", "{", "var", "viewList", "=", "pane", ".", "getViewList", "(", ")", ";", "result", "=", "...
Retrieves the WorkingSet for the given paneId not including temporary views @param {!string} paneId - id of the pane in which to get the view list, ALL_PANES or ACTIVE_PANE @return {Array.<File>}
[ "Retrieves", "the", "WorkingSet", "for", "the", "given", "paneId", "not", "including", "temporary", "views" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L530-L539
train
Get working set for pane or panes
[ 30522, 3853, 2131, 21398, 13462, 1006, 6090, 7416, 2094, 1007, 1063, 13075, 2765, 1027, 1031, 1033, 1025, 1035, 18921, 6776, 9739, 8780, 14536, 7231, 2015, 1006, 6090, 7416, 2094, 1010, 3853, 1006, 6090, 2063, 1007, 1063, 13075, 3193, 9863,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/EditorManager.js
_insertProviderSorted
function _insertProviderSorted(array, provider, priority) { var index, prioritizedProvider = { priority: priority, provider: provider }; for (index = 0; index < array.length; index++) { if (array[index].priority < priority) { break; } } array.splice(index, 0, prioritizedProvider); }
javascript
function _insertProviderSorted(array, provider, priority) { var index, prioritizedProvider = { priority: priority, provider: provider }; for (index = 0; index < array.length; index++) { if (array[index].priority < priority) { break; } } array.splice(index, 0, prioritizedProvider); }
[ "function", "_insertProviderSorted", "(", "array", ",", "provider", ",", "priority", ")", "{", "var", "index", ",", "prioritizedProvider", "=", "{", "priority", ":", "priority", ",", "provider", ":", "provider", "}", ";", "for", "(", "index", "=", "0", ";"...
Inserts a prioritized provider object into the array in sorted (descending) order. @private @param {Array.<{priority:number, provider:function(...)}>} array @param {number} priority @param {function(...)} provider
[ "Inserts", "a", "prioritized", "provider", "object", "into", "the", "array", "in", "sorted", "(", "descending", ")", "order", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorManager.js#L321-L335
train
Insert a new provider into the array sorted by priority
[ 30522, 3853, 1035, 19274, 21572, 17258, 2545, 15613, 1006, 9140, 1010, 10802, 1010, 9470, 1007, 1063, 13075, 5950, 1010, 3188, 25090, 5422, 21572, 17258, 2121, 1027, 1063, 9470, 1024, 9470, 1010, 10802, 1024, 10802, 1065, 1025, 2005, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
sass/node-sass
lib/extensions.js
getHumanEnvironment
function getHumanEnvironment(env) { var binding = env.replace(/_binding\.node$/, ''), parts = binding.split('-'), platform = getHumanPlatform(parts[0]), arch = getHumanArchitecture(parts[1]), runtime = getHumanNodeVersion(parts[2]); if (parts.length !== 3) { return 'Unknown environment (' + binding + ')'; } if (!platform) { platform = 'Unsupported platform (' + parts[0] + ')'; } if (!arch) { arch = 'Unsupported architecture (' + parts[1] + ')'; } if (!runtime) { runtime = 'Unsupported runtime (' + parts[2] + ')'; } return [ platform, arch, 'with', runtime, ].join(' '); }
javascript
function getHumanEnvironment(env) { var binding = env.replace(/_binding\.node$/, ''), parts = binding.split('-'), platform = getHumanPlatform(parts[0]), arch = getHumanArchitecture(parts[1]), runtime = getHumanNodeVersion(parts[2]); if (parts.length !== 3) { return 'Unknown environment (' + binding + ')'; } if (!platform) { platform = 'Unsupported platform (' + parts[0] + ')'; } if (!arch) { arch = 'Unsupported architecture (' + parts[1] + ')'; } if (!runtime) { runtime = 'Unsupported runtime (' + parts[2] + ')'; } return [ platform, arch, 'with', runtime, ].join(' '); }
[ "function", "getHumanEnvironment", "(", "env", ")", "{", "var", "binding", "=", "env", ".", "replace", "(", "/", "_binding\\.node$", "/", ",", "''", ")", ",", "parts", "=", "binding", ".", "split", "(", "'-'", ")", ",", "platform", "=", "getHumanPlatform...
Get a human readable description of where node-sass is running to support user error reporting when something goes wrong @param {string} env - The name of the native bindings that is to be parsed @return {string} A description of what os, architecture, and Node version that is being run @api public
[ "Get", "a", "human", "readable", "description", "of", "where", "node", "-", "sass", "is", "running", "to", "support", "user", "error", "reporting", "when", "something", "goes", "wrong" ]
0c1a49eefa37544d16041c5fe5b2e3d9168004b7
https://github.com/sass/node-sass/blob/0c1a49eefa37544d16041c5fe5b2e3d9168004b7/lib/extensions.js#L95-L121
train
Get a human readable environment
[ 30522, 3853, 2131, 28600, 7231, 2078, 21663, 2239, 3672, 1006, 4372, 2615, 1007, 1063, 13075, 8031, 1027, 4372, 2615, 1012, 5672, 1006, 1013, 1035, 8031, 1032, 1012, 13045, 1002, 1013, 1010, 1005, 1005, 1007, 1010, 3033, 1027, 8031, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.dt/src/sap/ui/dt/ContextMenuControl.js
function (bCompact) { if (sap.ui.Device.browser.internet_explorer || sap.ui.Device.browser.edge) { return bCompact ? 0.5 : 0.5; } else { return bCompact ? 0.5625 : 0.5625; } }
javascript
function (bCompact) { if (sap.ui.Device.browser.internet_explorer || sap.ui.Device.browser.edge) { return bCompact ? 0.5 : 0.5; } else { return bCompact ? 0.5625 : 0.5625; } }
[ "function", "(", "bCompact", ")", "{", "if", "(", "sap", ".", "ui", ".", "Device", ".", "browser", ".", "internet_explorer", "||", "sap", ".", "ui", ".", "Device", ".", "browser", ".", "edge", ")", "{", "return", "bCompact", "?", "0.5", ":", "0.5", ...
Returns the height of a popover arrow @param {boolean} bCompact wheter ContextMenu is compact @return {float} the height of a popover arrow
[ "Returns", "the", "height", "of", "a", "popover", "arrow" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.dt/src/sap/ui/dt/ContextMenuControl.js#L497-L503
train
Returns the number of nodes that are compact
[ 30522, 3853, 1006, 4647, 25377, 18908, 1007, 1063, 2065, 1006, 20066, 1012, 21318, 1012, 5080, 1012, 16602, 1012, 4274, 1035, 10566, 1064, 1064, 20066, 1012, 21318, 1012, 5080, 1012, 16602, 1012, 3341, 1007, 1063, 2709, 4647, 25377, 18908, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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-prop-getters.js
deepValueGetter
function deepValueGetter(obj, path) { if (obj == null) return ''; if (!obj || !path) return obj; // check if path matches a root-level field // { "a.b.c": 123 } var current = obj[path]; if (current !== undefined) return current; current = obj; var split = path.split('.'); if (split.length) { for (var i = 0; i < split.length; i++) { current = current[split[i]]; // if found undefined, return empty string if (current === undefined || current === null) return ''; } } return current; }
javascript
function deepValueGetter(obj, path) { if (obj == null) return ''; if (!obj || !path) return obj; // check if path matches a root-level field // { "a.b.c": 123 } var current = obj[path]; if (current !== undefined) return current; current = obj; var split = path.split('.'); if (split.length) { for (var i = 0; i < split.length; i++) { current = current[split[i]]; // if found undefined, return empty string if (current === undefined || current === null) return ''; } } return current; }
[ "function", "deepValueGetter", "(", "obj", ",", "path", ")", "{", "if", "(", "obj", "==", "null", ")", "return", "''", ";", "if", "(", "!", "obj", "||", "!", "path", ")", "return", "obj", ";", "// check if path matches a root-level field", "// { \"a.b.c\": 1...
Returns a deep object given a string. zoo['animal.type'] @param {object} obj @param {string} path
[ "Returns", "a", "deep", "object", "given", "a", "string", ".", "zoo", "[", "animal", ".", "type", "]" ]
d7df15a070282a169524dba51d9572008b74804c
https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/column-prop-getters.js#L74-L95
train
Get a value from an object by path
[ 30522, 3853, 2784, 10175, 5657, 18150, 3334, 1006, 27885, 3501, 1010, 4130, 1007, 1063, 2065, 1006, 27885, 3501, 1027, 1027, 19701, 1007, 2709, 1005, 1005, 1025, 2065, 1006, 999, 27885, 3501, 1064, 1064, 999, 4130, 1007, 2709, 27885, 3501, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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( elem, types, handler, data ) { if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // For whatever reason, IE has trouble passing the window object // around, causing it to be cloned in the process if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) { elem = window; } // Make sure that the function being executed has a unique ID if ( !handler.guid ) { handler.guid = jQuery.guid++; } // if data is passed, bind to handler if ( data !== undefined ) { // Create temporary function pointer to original handler var fn = handler; // Create unique handler function, wrapped around original handler handler = jQuery.proxy( fn ); // Store data in unique handler handler.data = data; } // Init the element's event structure var events = jQuery.data( elem, "events" ) || jQuery.data( elem, "events", {} ), handle = jQuery.data( elem, "handle" ), eventHandle; if ( !handle ) { eventHandle = function() { // Handle the second event of a trigger and when // an event is called after a page has unloaded return typeof jQuery !== "undefined" && !jQuery.event.triggered ? jQuery.event.handle.apply( eventHandle.elem, arguments ) : undefined; }; handle = jQuery.data( elem, "handle", eventHandle ); } // If no handle is found then we must be trying to bind to one of the // banned noData elements if ( !handle ) { return; } // Add elem as a property of the handle function // This is to prevent a memory leak with non-native // event in IE. handle.elem = elem; // Handle multiple events separated by a space // jQuery(...).bind("mouseover mouseout", fn); types = types.split( /\s+/ ); var type, i = 0; while ( (type = types[ i++ ]) ) { // Namespaced event handlers var namespaces = type.split("."); type = namespaces.shift(); if ( i > 1 ) { handler = jQuery.proxy( handler ); if ( data !== undefined ) { handler.data = data; } } handler.type = namespaces.slice(0).sort().join("."); // Get the current list of functions bound to this event var handlers = events[ type ], special = this.special[ type ] || {}; // Init the event handler queue if ( !handlers ) { handlers = events[ type ] = {}; // Check for a special event handler // Only use addEventListener/attachEvent if the special // events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, handler) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, handle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, handle ); } } } if ( special.add ) { var modifiedHandler = special.add.call( elem, handler, data, namespaces, handlers ); if ( modifiedHandler && jQuery.isFunction( modifiedHandler ) ) { modifiedHandler.guid = modifiedHandler.guid || handler.guid; modifiedHandler.data = modifiedHandler.data || handler.data; modifiedHandler.type = modifiedHandler.type || handler.type; handler = modifiedHandler; } } // Add the function to the element's handler list handlers[ handler.guid ] = handler; // Keep track of which events have been used, for global triggering this.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }
javascript
function( elem, types, handler, data ) { if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // For whatever reason, IE has trouble passing the window object // around, causing it to be cloned in the process if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) { elem = window; } // Make sure that the function being executed has a unique ID if ( !handler.guid ) { handler.guid = jQuery.guid++; } // if data is passed, bind to handler if ( data !== undefined ) { // Create temporary function pointer to original handler var fn = handler; // Create unique handler function, wrapped around original handler handler = jQuery.proxy( fn ); // Store data in unique handler handler.data = data; } // Init the element's event structure var events = jQuery.data( elem, "events" ) || jQuery.data( elem, "events", {} ), handle = jQuery.data( elem, "handle" ), eventHandle; if ( !handle ) { eventHandle = function() { // Handle the second event of a trigger and when // an event is called after a page has unloaded return typeof jQuery !== "undefined" && !jQuery.event.triggered ? jQuery.event.handle.apply( eventHandle.elem, arguments ) : undefined; }; handle = jQuery.data( elem, "handle", eventHandle ); } // If no handle is found then we must be trying to bind to one of the // banned noData elements if ( !handle ) { return; } // Add elem as a property of the handle function // This is to prevent a memory leak with non-native // event in IE. handle.elem = elem; // Handle multiple events separated by a space // jQuery(...).bind("mouseover mouseout", fn); types = types.split( /\s+/ ); var type, i = 0; while ( (type = types[ i++ ]) ) { // Namespaced event handlers var namespaces = type.split("."); type = namespaces.shift(); if ( i > 1 ) { handler = jQuery.proxy( handler ); if ( data !== undefined ) { handler.data = data; } } handler.type = namespaces.slice(0).sort().join("."); // Get the current list of functions bound to this event var handlers = events[ type ], special = this.special[ type ] || {}; // Init the event handler queue if ( !handlers ) { handlers = events[ type ] = {}; // Check for a special event handler // Only use addEventListener/attachEvent if the special // events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, handler) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, handle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, handle ); } } } if ( special.add ) { var modifiedHandler = special.add.call( elem, handler, data, namespaces, handlers ); if ( modifiedHandler && jQuery.isFunction( modifiedHandler ) ) { modifiedHandler.guid = modifiedHandler.guid || handler.guid; modifiedHandler.data = modifiedHandler.data || handler.data; modifiedHandler.type = modifiedHandler.type || handler.type; handler = modifiedHandler; } } // Add the function to the element's handler list handlers[ handler.guid ] = handler; // Keep track of which events have been used, for global triggering this.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }
[ "function", "(", "elem", ",", "types", ",", "handler", ",", "data", ")", "{", "if", "(", "elem", ".", "nodeType", "===", "3", "||", "elem", ".", "nodeType", "===", "8", ")", "{", "return", ";", "}", "// For whatever reason, IE has trouble passing the window ...
Bind an event to an element Original by Dean Edwards
[ "Bind", "an", "event", "to", "an", "element", "Original", "by", "Dean", "Edwards" ]
38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd
https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/htmlutils.js#L4145-L4261
train
The following functions are used to bind events to an element
[ 30522, 3853, 1006, 3449, 6633, 1010, 4127, 1010, 28213, 1010, 2951, 1007, 1063, 2065, 1006, 3449, 6633, 1012, 13045, 13874, 1027, 1027, 1027, 1017, 1064, 1064, 3449, 6633, 1012, 13045, 13874, 1027, 1027, 1027, 1022, 1007, 1063, 2709, 1025, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.ux3/src/sap/ui/ux3/NotificationBarRenderer.js
function(oRm, aNotifiers) { for ( var i = 0; i < aNotifiers.length; i++) { fnRenderNotifier(oRm, aNotifiers[i], false); } }
javascript
function(oRm, aNotifiers) { for ( var i = 0; i < aNotifiers.length; i++) { fnRenderNotifier(oRm, aNotifiers[i], false); } }
[ "function", "(", "oRm", ",", "aNotifiers", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "aNotifiers", ".", "length", ";", "i", "++", ")", "{", "fnRenderNotifier", "(", "oRm", ",", "aNotifiers", "[", "i", "]", ",", "false", ")", ";",...
Renders given map of notifiers
[ "Renders", "given", "map", "of", "notifiers" ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/NotificationBarRenderer.js#L420-L424
train
Renders the given notifiers.
[ 30522, 3853, 1006, 2030, 2213, 1010, 2019, 4140, 28295, 1007, 1063, 2005, 1006, 13075, 1045, 1027, 1014, 1025, 1045, 1026, 2019, 4140, 28295, 1012, 3091, 1025, 1045, 1009, 1009, 1007, 1063, 1042, 16118, 10497, 11795, 4140, 18095, 1006, 2030...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
aws/aws-sdk-js
lib/discover_endpoint.js
isEndpointDiscoveryApplicable
function isEndpointDiscoveryApplicable(request) { var service = request.service || {}; if (service.config.endpointDiscoveryEnabled === true) return true; //shared ini file is only available in Node //not to check env in browser if (util.isBrowser()) return false; for (var i = 0; i < endpointDiscoveryEnabledEnvs.length; i++) { var env = endpointDiscoveryEnabledEnvs[i]; if (Object.prototype.hasOwnProperty.call(process.env, env)) { if (process.env[env] === '' || process.env[env] === undefined) { throw util.error(new Error(), { code: 'ConfigurationException', message: 'environmental variable ' + env + ' cannot be set to nothing' }); } if (!isFalsy(process.env[env])) return true; } } var configFile = {}; try { configFile = AWS.util.iniLoader ? AWS.util.iniLoader.loadFrom({ isConfig: true, filename: process.env[AWS.util.sharedConfigFileEnv] }) : {}; } catch (e) {} var sharedFileConfig = configFile[ process.env.AWS_PROFILE || AWS.util.defaultProfile ] || {}; if (Object.prototype.hasOwnProperty.call(sharedFileConfig, 'endpoint_discovery_enabled')) { if (sharedFileConfig.endpoint_discovery_enabled === undefined) { throw util.error(new Error(), { code: 'ConfigurationException', message: 'config file entry \'endpoint_discovery_enabled\' cannot be set to nothing' }); } if (!isFalsy(sharedFileConfig.endpoint_discovery_enabled)) return true; } return false; }
javascript
function isEndpointDiscoveryApplicable(request) { var service = request.service || {}; if (service.config.endpointDiscoveryEnabled === true) return true; //shared ini file is only available in Node //not to check env in browser if (util.isBrowser()) return false; for (var i = 0; i < endpointDiscoveryEnabledEnvs.length; i++) { var env = endpointDiscoveryEnabledEnvs[i]; if (Object.prototype.hasOwnProperty.call(process.env, env)) { if (process.env[env] === '' || process.env[env] === undefined) { throw util.error(new Error(), { code: 'ConfigurationException', message: 'environmental variable ' + env + ' cannot be set to nothing' }); } if (!isFalsy(process.env[env])) return true; } } var configFile = {}; try { configFile = AWS.util.iniLoader ? AWS.util.iniLoader.loadFrom({ isConfig: true, filename: process.env[AWS.util.sharedConfigFileEnv] }) : {}; } catch (e) {} var sharedFileConfig = configFile[ process.env.AWS_PROFILE || AWS.util.defaultProfile ] || {}; if (Object.prototype.hasOwnProperty.call(sharedFileConfig, 'endpoint_discovery_enabled')) { if (sharedFileConfig.endpoint_discovery_enabled === undefined) { throw util.error(new Error(), { code: 'ConfigurationException', message: 'config file entry \'endpoint_discovery_enabled\' cannot be set to nothing' }); } if (!isFalsy(sharedFileConfig.endpoint_discovery_enabled)) return true; } return false; }
[ "function", "isEndpointDiscoveryApplicable", "(", "request", ")", "{", "var", "service", "=", "request", ".", "service", "||", "{", "}", ";", "if", "(", "service", ".", "config", ".", "endpointDiscoveryEnabled", "===", "true", ")", "return", "true", ";", "//...
If endpoint discovery should perform for this request when endpoint discovery is optional. SDK performs config resolution in order like below: 1. If turned on client configuration(default to off) then turn on endpoint discovery. 2. If turned on in env AWS_ENABLE_ENDPOINT_DISCOVERY then turn on endpoint discovery. 3. If turned on in shared ini config file with key 'endpoint_discovery_enabled', then turn on endpoint discovery. @param [object] request request object. @api private
[ "If", "endpoint", "discovery", "should", "perform", "for", "this", "request", "when", "endpoint", "discovery", "is", "optional", ".", "SDK", "performs", "config", "resolution", "in", "order", "like", "below", ":", "1", ".", "If", "turned", "on", "client", "c...
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/discover_endpoint.js#L276-L317
train
Check if endpoint discovery is applicable
[ 30522, 3853, 2003, 10497, 8400, 10521, 3597, 27900, 29098, 19341, 3468, 1006, 5227, 1007, 1063, 13075, 2326, 1027, 5227, 1012, 2326, 1064, 1064, 1063, 1065, 1025, 2065, 1006, 2326, 1012, 9530, 8873, 2290, 1012, 2203, 8400, 10521, 3597, 2790...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/permission.js
permittedAttributes
function permittedAttributes() { let filteredKeys = ghostBookshelf.Model.prototype.permittedAttributes.apply(this, arguments); this.relationships.forEach((key) => { filteredKeys.push(key); }); return filteredKeys; }
javascript
function permittedAttributes() { let filteredKeys = ghostBookshelf.Model.prototype.permittedAttributes.apply(this, arguments); this.relationships.forEach((key) => { filteredKeys.push(key); }); return filteredKeys; }
[ "function", "permittedAttributes", "(", ")", "{", "let", "filteredKeys", "=", "ghostBookshelf", ".", "Model", ".", "prototype", ".", "permittedAttributes", ".", "apply", "(", "this", ",", "arguments", ")", ";", "this", ".", "relationships", ".", "forEach", "("...
The base model keeps only the columns, which are defined in the schema. We have to add the relations on top, otherwise bookshelf-relations has no access to the nested relations, which should be updated.
[ "The", "base", "model", "keeps", "only", "the", "columns", "which", "are", "defined", "in", "the", "schema", ".", "We", "have", "to", "add", "the", "relations", "on", "top", "otherwise", "bookshelf", "-", "relations", "has", "no", "access", "to", "the", ...
bb7bb55cf3e60af99ebbc56099928827b58461bc
https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/models/permission.js#L20-L28
train
Returns an array of keys that are not permitted to the model
[ 30522, 3853, 7936, 19321, 3089, 8569, 4570, 1006, 1007, 1063, 2292, 21839, 14839, 2015, 1027, 5745, 17470, 16001, 2546, 1012, 2944, 1012, 8773, 1012, 7936, 19321, 3089, 8569, 4570, 1012, 6611, 1006, 2023, 1010, 9918, 1007, 1025, 2023, 1012,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/core/BlockLayerUtils.js
removeTabbable
function removeTabbable(oBlockSpan, fnRedirectFocus) { if (oBlockSpan.parentNode) { oBlockSpan.parentNode.removeChild(oBlockSpan); } oBlockSpan.removeEventListener('focusin', fnRedirectFocus); }
javascript
function removeTabbable(oBlockSpan, fnRedirectFocus) { if (oBlockSpan.parentNode) { oBlockSpan.parentNode.removeChild(oBlockSpan); } oBlockSpan.removeEventListener('focusin', fnRedirectFocus); }
[ "function", "removeTabbable", "(", "oBlockSpan", ",", "fnRedirectFocus", ")", "{", "if", "(", "oBlockSpan", ".", "parentNode", ")", "{", "oBlockSpan", ".", "parentNode", ".", "removeChild", "(", "oBlockSpan", ")", ";", "}", "oBlockSpan", ".", "removeEventListene...
Create a tabbable span for the block section of the control with according focus handling. @param {function} fnRedirectFocus Focus handling function @returns {object} The span element's DOM node @private
[ "Create", "a", "tabbable", "span", "for", "the", "block", "section", "of", "the", "control", "with", "according", "focus", "handling", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/BlockLayerUtils.js#L278-L283
train
Removes a tabbable element from the DOM.
[ 30522, 3853, 6366, 2696, 22414, 3468, 1006, 27885, 7878, 13102, 2319, 1010, 1042, 16118, 2098, 7442, 6593, 14876, 7874, 1007, 1063, 2065, 1006, 27885, 7878, 13102, 2319, 1012, 6687, 3630, 3207, 1007, 1063, 27885, 7878, 13102, 2319, 1012, 66...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/downloads.js
downloadManager_close
function downloadManager_close(force) { var windowCount = mozmill.utils.getWindows().length; if (this._controller) { // Check if we should force the closing of the DM window if (force) { this._controller.window.close(); } else { var cmdKey = utils.getEntity(this.getDtds(), "cmd.close.commandKey"); this._controller.keypress(null, cmdKey, {accelKey: true}); } this._controller.waitForEval("subject.getWindows().length == " + (windowCount - 1), gTimeout, 100, mozmill.utils); this._controller = null; } }
javascript
function downloadManager_close(force) { var windowCount = mozmill.utils.getWindows().length; if (this._controller) { // Check if we should force the closing of the DM window if (force) { this._controller.window.close(); } else { var cmdKey = utils.getEntity(this.getDtds(), "cmd.close.commandKey"); this._controller.keypress(null, cmdKey, {accelKey: true}); } this._controller.waitForEval("subject.getWindows().length == " + (windowCount - 1), gTimeout, 100, mozmill.utils); this._controller = null; } }
[ "function", "downloadManager_close", "(", "force", ")", "{", "var", "windowCount", "=", "mozmill", ".", "utils", ".", "getWindows", "(", ")", ".", "length", ";", "if", "(", "this", ".", "_controller", ")", "{", "// Check if we should force the closing of the DM wi...
Close the download manager @param {boolean} force Force the closing of the DM window
[ "Close", "the", "download", "manager" ]
38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd
https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/downloads.js#L155-L171
train
Close the download manager
[ 30522, 3853, 8816, 24805, 4590, 1035, 2485, 1006, 2486, 1007, 1063, 13075, 3332, 3597, 16671, 1027, 9587, 2480, 19912, 1012, 21183, 12146, 1012, 2131, 11101, 15568, 1006, 1007, 1012, 3091, 1025, 2065, 1006, 2023, 1012, 1035, 11486, 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...
muaz-khan/RTCMultiConnection
dev/ios-hacks.js
setCordovaAPIs
function setCordovaAPIs() { // if (DetectRTC.osName !== 'iOS') return; if (typeof cordova === 'undefined' || typeof cordova.plugins === 'undefined' || typeof cordova.plugins.iosrtc === 'undefined') return; var iosrtc = cordova.plugins.iosrtc; window.webkitRTCPeerConnection = iosrtc.RTCPeerConnection; window.RTCSessionDescription = iosrtc.RTCSessionDescription; window.RTCIceCandidate = iosrtc.RTCIceCandidate; window.MediaStream = iosrtc.MediaStream; window.MediaStreamTrack = iosrtc.MediaStreamTrack; navigator.getUserMedia = navigator.webkitGetUserMedia = iosrtc.getUserMedia; iosrtc.debug.enable('iosrtc*'); if (typeof iosrtc.selectAudioOutput == 'function') { iosrtc.selectAudioOutput(window.iOSDefaultAudioOutputDevice || 'speaker'); // earpiece or speaker } iosrtc.registerGlobals(); }
javascript
function setCordovaAPIs() { // if (DetectRTC.osName !== 'iOS') return; if (typeof cordova === 'undefined' || typeof cordova.plugins === 'undefined' || typeof cordova.plugins.iosrtc === 'undefined') return; var iosrtc = cordova.plugins.iosrtc; window.webkitRTCPeerConnection = iosrtc.RTCPeerConnection; window.RTCSessionDescription = iosrtc.RTCSessionDescription; window.RTCIceCandidate = iosrtc.RTCIceCandidate; window.MediaStream = iosrtc.MediaStream; window.MediaStreamTrack = iosrtc.MediaStreamTrack; navigator.getUserMedia = navigator.webkitGetUserMedia = iosrtc.getUserMedia; iosrtc.debug.enable('iosrtc*'); if (typeof iosrtc.selectAudioOutput == 'function') { iosrtc.selectAudioOutput(window.iOSDefaultAudioOutputDevice || 'speaker'); // earpiece or speaker } iosrtc.registerGlobals(); }
[ "function", "setCordovaAPIs", "(", ")", "{", "// if (DetectRTC.osName !== 'iOS') return;", "if", "(", "typeof", "cordova", "===", "'undefined'", "||", "typeof", "cordova", ".", "plugins", "===", "'undefined'", "||", "typeof", "cordova", ".", "plugins", ".", "iosrtc"...
ios-hacks.js
[ "ios", "-", "hacks", ".", "js" ]
2032ce949bde30b43a3d2666e0f1e5afbf337f3d
https://github.com/muaz-khan/RTCMultiConnection/blob/2032ce949bde30b43a3d2666e0f1e5afbf337f3d/dev/ios-hacks.js#L3-L20
train
set cordova APIs
[ 30522, 3853, 2275, 27108, 3527, 3567, 9331, 2483, 1006, 1007, 1063, 1013, 1013, 2065, 1006, 11487, 5339, 2278, 1012, 9808, 18442, 999, 1027, 1027, 1005, 16380, 1005, 1007, 2709, 1025, 2065, 1006, 2828, 11253, 11601, 7103, 1027, 1027, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
SAP/openui5
src/sap.ui.core/src/sap/ui/base/BindingParser.js
expression
function expression(sInput, iStart, oBindingMode) { var oBinding = ExpressionParser.parse(resolveEmbeddedBinding.bind(null, oEnv), sString, iStart, null, bStaticContext ? oContext : null); /** * Recursively sets the mode <code>oBindingMode</code> on the given binding (or its * parts). * * @param {object} oBinding * a binding which may be composite * @param {int} [iIndex] * index provided by <code>forEach</code> */ function setMode(oBinding, iIndex) { if (oBinding.parts) { oBinding.parts.forEach(function (vPart, i) { if (typeof vPart === "string") { vPart = oBinding.parts[i] = {path : vPart}; } setMode(vPart, i); }); b2ndLevelMergedNeeded = b2ndLevelMergedNeeded || iIndex !== undefined; } else { oBinding.mode = oBindingMode; } } if (sInput.charAt(oBinding.at) !== "}") { throw new SyntaxError("Expected '}' and instead saw '" + sInput.charAt(oBinding.at) + "' in expression binding " + sInput + " at position " + oBinding.at); } oBinding.at += 1; if (oBinding.result) { setMode(oBinding.result); } else { aFragments[aFragments.length - 1] = String(oBinding.constant); bUnescaped = true; } return oBinding; }
javascript
function expression(sInput, iStart, oBindingMode) { var oBinding = ExpressionParser.parse(resolveEmbeddedBinding.bind(null, oEnv), sString, iStart, null, bStaticContext ? oContext : null); /** * Recursively sets the mode <code>oBindingMode</code> on the given binding (or its * parts). * * @param {object} oBinding * a binding which may be composite * @param {int} [iIndex] * index provided by <code>forEach</code> */ function setMode(oBinding, iIndex) { if (oBinding.parts) { oBinding.parts.forEach(function (vPart, i) { if (typeof vPart === "string") { vPart = oBinding.parts[i] = {path : vPart}; } setMode(vPart, i); }); b2ndLevelMergedNeeded = b2ndLevelMergedNeeded || iIndex !== undefined; } else { oBinding.mode = oBindingMode; } } if (sInput.charAt(oBinding.at) !== "}") { throw new SyntaxError("Expected '}' and instead saw '" + sInput.charAt(oBinding.at) + "' in expression binding " + sInput + " at position " + oBinding.at); } oBinding.at += 1; if (oBinding.result) { setMode(oBinding.result); } else { aFragments[aFragments.length - 1] = String(oBinding.constant); bUnescaped = true; } return oBinding; }
[ "function", "expression", "(", "sInput", ",", "iStart", ",", "oBindingMode", ")", "{", "var", "oBinding", "=", "ExpressionParser", ".", "parse", "(", "resolveEmbeddedBinding", ".", "bind", "(", "null", ",", "oEnv", ")", ",", "sString", ",", "iStart", ",", ...
Parses an expression. Sets the flags accordingly. @param {string} sInput The input string to parse from @param {int} iStart The start index @param {sap.ui.model.BindingMode} oBindingMode the binding mode @returns {object} a result object with the binding in <code>result</code> and the index after the last character belonging to the expression in <code>at</code> @throws SyntaxError if the expression string is invalid
[ "Parses", "an", "expression", ".", "Sets", "the", "flags", "accordingly", "." ]
8a832fca01cb1cdf8df589788e0c5723e2a33c70
https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/BindingParser.js#L415-L458
train
Parses an embedded expression and sets the mode of the binding.
[ 30522, 3853, 3670, 1006, 8254, 18780, 1010, 21541, 8445, 1010, 27885, 22254, 2075, 5302, 3207, 1007, 1063, 13075, 27885, 22254, 2075, 1027, 3670, 19362, 8043, 1012, 11968, 3366, 1006, 10663, 6633, 8270, 5732, 8428, 4667, 1012, 14187, 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...
aws/aws-sdk-js
lib/discover_endpoint.js
invalidateCachedEndpoints
function invalidateCachedEndpoints(response) { var error = response.error; var httpResponse = response.httpResponse; if (error && (error.code === 'InvalidEndpointException' || httpResponse.statusCode === 421) ) { var request = response.request; var operations = request.service.api.operations || {}; var inputShape = operations[request.operation] ? operations[request.operation].input : undefined; var identifiers = marshallCustomIdentifiers(request, inputShape); var cacheKey = getCacheKey(request); if (Object.keys(identifiers).length > 0) { cacheKey = util.update(cacheKey, identifiers); if (operations[request.operation]) cacheKey.operation = operations[request.operation].name; } AWS.endpointCache.remove(cacheKey); } }
javascript
function invalidateCachedEndpoints(response) { var error = response.error; var httpResponse = response.httpResponse; if (error && (error.code === 'InvalidEndpointException' || httpResponse.statusCode === 421) ) { var request = response.request; var operations = request.service.api.operations || {}; var inputShape = operations[request.operation] ? operations[request.operation].input : undefined; var identifiers = marshallCustomIdentifiers(request, inputShape); var cacheKey = getCacheKey(request); if (Object.keys(identifiers).length > 0) { cacheKey = util.update(cacheKey, identifiers); if (operations[request.operation]) cacheKey.operation = operations[request.operation].name; } AWS.endpointCache.remove(cacheKey); } }
[ "function", "invalidateCachedEndpoints", "(", "response", ")", "{", "var", "error", "=", "response", ".", "error", ";", "var", "httpResponse", "=", "response", ".", "httpResponse", ";", "if", "(", "error", "&&", "(", "error", ".", "code", "===", "'InvalidEnd...
If api call gets invalid endpoint exception, SDK should attempt to remove the invalid endpoint from cache. @api private
[ "If", "api", "call", "gets", "invalid", "endpoint", "exception", "SDK", "should", "attempt", "to", "remove", "the", "invalid", "endpoint", "from", "cache", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/discover_endpoint.js#L223-L240
train
Invalidate the cached endpoints if any
[ 30522, 3853, 19528, 3686, 3540, 7690, 10497, 26521, 1006, 3433, 1007, 1063, 13075, 7561, 1027, 3433, 1012, 7561, 1025, 13075, 8299, 6072, 26029, 3366, 1027, 3433, 1012, 8299, 6072, 26029, 3366, 1025, 2065, 1006, 7561, 1004, 1004, 1006, 7561...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...