repo stringclasses 192
values | path stringlengths 4 115 | func_name stringlengths 0 45 | original_string stringlengths 74 24k | language stringclasses 1
value | code stringlengths 74 24k | code_tokens listlengths 23 4.2k | docstring stringlengths 2 23.7k | docstring_tokens listlengths 1 810 | sha stringclasses 192
values | url stringlengths 90 200 | partition stringclasses 1
value | summary stringlengths 6 313 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
adobe/brackets | src/language/JSONUtils.js | stripQuotes | function stripQuotes(string) {
if (string) {
if (/^['"]$/.test(string.charAt(0))) {
string = string.substr(1);
}
if (/^['"]$/.test(string.substr(-1, 1))) {
string = string.substr(0, string.length - 1);
}
}
return str... | javascript | function stripQuotes(string) {
if (string) {
if (/^['"]$/.test(string.charAt(0))) {
string = string.substr(1);
}
if (/^['"]$/.test(string.substr(-1, 1))) {
string = string.substr(0, string.length - 1);
}
}
return str... | [
"function",
"stripQuotes",
"(",
"string",
")",
"{",
"if",
"(",
"string",
")",
"{",
"if",
"(",
"/",
"^['\"]$",
"/",
".",
"test",
"(",
"string",
".",
"charAt",
"(",
"0",
")",
")",
")",
"{",
"string",
"=",
"string",
".",
"substr",
"(",
"1",
")",
"... | Removes the quotes around a string
@param {!String} string
@return {String} | [
"Removes",
"the",
"quotes",
"around",
"a",
"string"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/JSONUtils.js#L75-L85 | train | strip quotes from string | [
30522,
3853,
6167,
28940,
12184,
2015,
1006,
5164,
1007,
1063,
2065,
1006,
5164,
1007,
1063,
2065,
1006,
1013,
1034,
1031,
1005,
1000,
1033,
1002,
1013,
1012,
3231,
1006,
5164,
1012,
25869,
30524,
1010,
1015,
1007,
1007,
1007,
1063,
5164,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/JavaScriptRefactoring/RenameIdentifier.js | requestFindReferences | function requestFindReferences(session, offset) {
var response = requestFindRefs(session, session.editor.document, offset);
if (response && response.hasOwnProperty("promise")) {
response.promise.done(handleFindRefs).fail(function () {
result.reject();
... | javascript | function requestFindReferences(session, offset) {
var response = requestFindRefs(session, session.editor.document, offset);
if (response && response.hasOwnProperty("promise")) {
response.promise.done(handleFindRefs).fail(function () {
result.reject();
... | [
"function",
"requestFindReferences",
"(",
"session",
",",
"offset",
")",
"{",
"var",
"response",
"=",
"requestFindRefs",
"(",
"session",
",",
"session",
".",
"editor",
".",
"document",
",",
"offset",
")",
";",
"if",
"(",
"response",
"&&",
"response",
".",
... | Make a find ref request.
@param {Session} session - the session
@param {number} offset - the offset of where to jump from | [
"Make",
"a",
"find",
"ref",
"request",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptRefactoring/RenameIdentifier.js#L169-L177 | train | Request find references | [
30522,
3853,
5227,
16294,
16200,
25523,
2015,
1006,
5219,
1010,
16396,
1007,
1063,
13075,
3433,
1027,
5227,
16294,
16200,
10343,
1006,
5219,
1010,
5219,
1012,
3559,
1012,
6254,
1010,
16396,
1007,
1025,
2065,
1006,
3433,
1004,
1004,
3433,
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... |
semantic-release/semantic-release | lib/git.js | verifyAuth | async function verifyAuth(repositoryUrl, branch, execaOpts) {
try {
await execa('git', ['push', '--dry-run', repositoryUrl, `HEAD:${branch}`], execaOpts);
} catch (error) {
debug(error);
throw error;
}
} | javascript | async function verifyAuth(repositoryUrl, branch, execaOpts) {
try {
await execa('git', ['push', '--dry-run', repositoryUrl, `HEAD:${branch}`], execaOpts);
} catch (error) {
debug(error);
throw error;
}
} | [
"async",
"function",
"verifyAuth",
"(",
"repositoryUrl",
",",
"branch",
",",
"execaOpts",
")",
"{",
"try",
"{",
"await",
"execa",
"(",
"'git'",
",",
"[",
"'push'",
",",
"'--dry-run'",
",",
"repositoryUrl",
",",
"`",
"${",
"branch",
"}",
"`",
"]",
",",
... | Verify the write access authorization to remote repository with push dry-run.
@param {String} repositoryUrl The remote repository URL.
@param {String} branch The repositoru branch for which to verify write access.
@param {Object} [execaOpts] Options to pass to `execa`.
@throws {Error} if not authorized to push. | [
"Verify",
"the",
"write",
"access",
"authorization",
"to",
"remote",
"repository",
"with",
"push",
"dry",
"-",
"run",
"."
] | edf382f88838ed543c0b76cb6c914cca1fc1ddd1 | https://github.com/semantic-release/semantic-release/blob/edf382f88838ed543c0b76cb6c914cca1fc1ddd1/lib/git.js#L121-L128 | train | Verify auth for the branch | [
30522,
2004,
6038,
2278,
3853,
20410,
4887,
2705,
1006,
22409,
3126,
2140,
1010,
3589,
1010,
4654,
19281,
7361,
3215,
1007,
1063,
3046,
1063,
26751,
4654,
19281,
1006,
1005,
21025,
2102,
1005,
1010,
1031,
1005,
5245,
1005,
1010,
1005,
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... |
websockets/ws | lib/buffer-util.js | _mask | function _mask(source, mask, output, offset, length) {
for (let i = 0; i < length; i++) {
output[offset + i] = source[i] ^ mask[i & 3];
}
} | javascript | function _mask(source, mask, output, offset, length) {
for (let i = 0; i < length; i++) {
output[offset + i] = source[i] ^ mask[i & 3];
}
} | [
"function",
"_mask",
"(",
"source",
",",
"mask",
",",
"output",
",",
"offset",
",",
"length",
")",
"{",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
"<",
"length",
";",
"i",
"++",
")",
"{",
"output",
"[",
"offset",
"+",
"i",
"]",
"=",
"source",
... | Masks a buffer using the given mask.
@param {Buffer} source The buffer to mask
@param {Buffer} mask The mask to use
@param {Buffer} output The buffer where to store the result
@param {Number} offset The offset at which to start writing
@param {Number} length The number of bytes to mask.
@public | [
"Masks",
"a",
"buffer",
"using",
"the",
"given",
"mask",
"."
] | 995c527c87d0d4833d8093c18dcfa2e4a41d9582 | https://github.com/websockets/ws/blob/995c527c87d0d4833d8093c18dcfa2e4a41d9582/lib/buffer-util.js#L39-L43 | train | Mask the given source array with the given mask. | [
30522,
3853,
1035,
7308,
1006,
3120,
1010,
7308,
1010,
6434,
1010,
16396,
1010,
3091,
1007,
1063,
2005,
1006,
2292,
1045,
1027,
1014,
1025,
1045,
1026,
3091,
1025,
1045,
1009,
1009,
1007,
1063,
6434,
1031,
16396,
1009,
1045,
1033,
1027,
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... |
adobe/brackets | src/utils/StringUtils.js | truncate | function truncate(str, len) {
// Truncate text to specified length
if (str.length > len) {
str = str.substr(0, len);
// To prevent awkwardly truncating in the middle of a word,
// attempt to truncate at the end of the last whole word
var lastSpaceChar = s... | javascript | function truncate(str, len) {
// Truncate text to specified length
if (str.length > len) {
str = str.substr(0, len);
// To prevent awkwardly truncating in the middle of a word,
// attempt to truncate at the end of the last whole word
var lastSpaceChar = s... | [
"function",
"truncate",
"(",
"str",
",",
"len",
")",
"{",
"// Truncate text to specified length",
"if",
"(",
"str",
".",
"length",
">",
"len",
")",
"{",
"str",
"=",
"str",
".",
"substr",
"(",
"0",
",",
"len",
")",
";",
"// To prevent awkwardly truncating in ... | Truncate text to specified length.
@param {string} str Text to be truncated.
@param {number} len Length to which text should be truncated
@return {?string} Returns truncated text only if it was changed | [
"Truncate",
"text",
"to",
"specified",
"length",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/StringUtils.js#L213-L226 | train | Truncate text to specified length | [
30522,
3853,
19817,
4609,
16280,
1006,
2358,
2099,
1010,
18798,
1007,
1063,
1013,
1013,
19817,
4609,
16280,
3793,
2000,
9675,
3091,
2065,
30524,
2203,
1997,
1996,
2197,
2878,
2773,
13075,
16180,
15327,
7507,
2099,
1027,
2358,
2099,
1012,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/icon/js/iconService.js | prepareAndStyle | function prepareAndStyle() {
var viewBoxSize = this.config ? this.config.viewBoxSize : config.defaultViewBoxSize;
angular.forEach({
'fit': '',
'height': '100%',
'width': '100%',
'preserveAspectRatio': 'xMidYMid meet',
'viewBox': this.element.getAttribute('viewBox') || ('0 0 ' + vie... | javascript | function prepareAndStyle() {
var viewBoxSize = this.config ? this.config.viewBoxSize : config.defaultViewBoxSize;
angular.forEach({
'fit': '',
'height': '100%',
'width': '100%',
'preserveAspectRatio': 'xMidYMid meet',
'viewBox': this.element.getAttribute('viewBox') || ('0 0 ' + vie... | [
"function",
"prepareAndStyle",
"(",
")",
"{",
"var",
"viewBoxSize",
"=",
"this",
".",
"config",
"?",
"this",
".",
"config",
".",
"viewBoxSize",
":",
"config",
".",
"defaultViewBoxSize",
";",
"angular",
".",
"forEach",
"(",
"{",
"'fit'",
":",
"''",
",",
"... | Prepare the DOM element that will be cached in the
loaded iconCache store. | [
"Prepare",
"the",
"DOM",
"element",
"that",
"will",
"be",
"cached",
"in",
"the",
"loaded",
"iconCache",
"store",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/icon/js/iconService.js#L712-L724 | train | Prepare and apply the viewBox and viewBox size | [
30522,
3853,
7374,
29560,
27983,
1006,
1007,
1063,
13075,
3193,
8758,
5332,
4371,
1027,
2023,
1012,
9530,
8873,
2290,
1029,
2023,
1012,
9530,
8873,
2290,
1012,
3193,
8758,
5332,
4371,
1024,
9530,
8873,
2290,
1012,
12398,
8584,
8758,
5332,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | spec/api-net-spec.js | randomBuffer | function randomBuffer (size, start, end) {
start = start || 0
end = end || 255
const range = 1 + end - start
const buffer = Buffer.allocUnsafe(size)
for (let i = 0; i < size; ++i) {
buffer[i] = start + Math.floor(Math.random() * range)
}
return buffer
} | javascript | function randomBuffer (size, start, end) {
start = start || 0
end = end || 255
const range = 1 + end - start
const buffer = Buffer.allocUnsafe(size)
for (let i = 0; i < size; ++i) {
buffer[i] = start + Math.floor(Math.random() * range)
}
return buffer
} | [
"function",
"randomBuffer",
"(",
"size",
",",
"start",
",",
"end",
")",
"{",
"start",
"=",
"start",
"||",
"0",
"end",
"=",
"end",
"||",
"255",
"const",
"range",
"=",
"1",
"+",
"end",
"-",
"start",
"const",
"buffer",
"=",
"Buffer",
".",
"allocUnsafe",... | /* The whole net API doesn't use standard callbacks /* eslint-disable standard/no-callback-literal | [
"/",
"*",
"The",
"whole",
"net",
"API",
"doesn",
"t",
"use",
"standard",
"callbacks",
"/",
"*",
"eslint",
"-",
"disable",
"standard",
"/",
"no",
"-",
"callback",
"-",
"literal"
] | 6e29611788277729647acf465f10db1ea6f15788 | https://github.com/electron/electron/blob/6e29611788277729647acf465f10db1ea6f15788/spec/api-net-spec.js#L13-L22 | train | Creates a random buffer | [
30522,
3853,
6721,
8569,
12494,
1006,
2946,
1010,
2707,
1010,
2203,
1007,
1063,
2707,
1027,
2707,
1064,
1064,
1014,
2203,
1027,
2203,
1064,
1064,
20637,
9530,
3367,
2846,
1027,
1015,
1009,
2203,
1011,
2707,
9530,
3367,
17698,
1027,
17698,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/core/utils/collect-results-from-frames.js | collectResultsFromFrames | function collectResultsFromFrames(
context,
options,
command,
parameter,
resolve,
reject
) {
'use strict';
var q = axe.utils.queue();
var frames = context.frames;
// Tell each axe running in each frame to collect results
frames.forEach(function(frame) {
var params = {
options: options,
command: com... | javascript | function collectResultsFromFrames(
context,
options,
command,
parameter,
resolve,
reject
) {
'use strict';
var q = axe.utils.queue();
var frames = context.frames;
// Tell each axe running in each frame to collect results
frames.forEach(function(frame) {
var params = {
options: options,
command: com... | [
"function",
"collectResultsFromFrames",
"(",
"context",
",",
"options",
",",
"command",
",",
"parameter",
",",
"resolve",
",",
"reject",
")",
"{",
"'use strict'",
";",
"var",
"q",
"=",
"axe",
".",
"utils",
".",
"queue",
"(",
")",
";",
"var",
"frames",
"=... | Sends a message to axe running in frames to start analysis and collate results (via `mergeResults`)
@private
@param {Context} context The resolved Context object
@param {Object} options Options object (as passed to `runRules`)
@param {string} command Command sent to all frames
@param {Array} parameter... | [
"Sends",
"a",
"message",
"to",
"axe",
"running",
"in",
"frames",
"to",
"start",
"analysis",
"and",
"collate",
"results",
"(",
"via",
"mergeResults",
")"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/utils/collect-results-from-frames.js#L74-L125 | train | Collect results from all frames | [
30522,
3853,
8145,
6072,
11314,
22747,
21716,
15643,
2015,
1006,
6123,
1010,
7047,
1010,
3094,
1010,
16381,
1010,
10663,
1010,
15454,
1007,
1063,
1005,
2224,
9384,
1005,
1025,
13075,
1053,
1027,
12946,
1012,
21183,
12146,
1012,
24240,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
facebook/relay | scripts/rewrite-modules.js | transformJestHelper | function transformJestHelper(path, state) {
var calleePath = path.get('callee');
var args = path.get('arguments');
if (!args.length) {
return;
}
var moduleArg = args[0];
if (
moduleArg.node.type === 'StringLiteral' &&
calleePath.node &&
isJestProperty(t, calleePath.node.p... | javascript | function transformJestHelper(path, state) {
var calleePath = path.get('callee');
var args = path.get('arguments');
if (!args.length) {
return;
}
var moduleArg = args[0];
if (
moduleArg.node.type === 'StringLiteral' &&
calleePath.node &&
isJestProperty(t, calleePath.node.p... | [
"function",
"transformJestHelper",
"(",
"path",
",",
"state",
")",
"{",
"var",
"calleePath",
"=",
"path",
".",
"get",
"(",
"'callee'",
")",
";",
"var",
"args",
"=",
"path",
".",
"get",
"(",
"'arguments'",
")",
";",
"if",
"(",
"!",
"args",
".",
"lengt... | Transforms either individual or chained calls to `jest.dontMock('Foo')`,
`jest.mock('Foo')`, and `jest.genMockFromModule('Foo')`. | [
"Transforms",
"either",
"individual",
"or",
"chained",
"calls",
"to",
"jest",
".",
"dontMock",
"(",
"Foo",
")",
"jest",
".",
"mock",
"(",
"Foo",
")",
"and",
"jest",
".",
"genMockFromModule",
"(",
"Foo",
")",
"."
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/scripts/rewrite-modules.js#L98-L115 | train | Transform a Jest function call to a module | [
30522,
3853,
10938,
6460,
3367,
16001,
4842,
1006,
4130,
1010,
2110,
1007,
1063,
13075,
2655,
4402,
15069,
1027,
4130,
1012,
2131,
1006,
1005,
2655,
4402,
1005,
1007,
1025,
13075,
12098,
5620,
1027,
4130,
1012,
2131,
1006,
1005,
9918,
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... |
Freeboard/freeboard | js/freeboard.thirdparty.js | function(input) {
var showAnim, duration, postProcess, onClose,
inst = this._curInst;
if (!inst || (input && inst !== $.data(input, PROP_NAME))) {
return;
}
if (this._datepickerShowing) {
showAnim = this._get(inst, "showAnim");
duration = this._get(inst, "duration");
postProcess = function() {
... | javascript | function(input) {
var showAnim, duration, postProcess, onClose,
inst = this._curInst;
if (!inst || (input && inst !== $.data(input, PROP_NAME))) {
return;
}
if (this._datepickerShowing) {
showAnim = this._get(inst, "showAnim");
duration = this._get(inst, "duration");
postProcess = function() {
... | [
"function",
"(",
"input",
")",
"{",
"var",
"showAnim",
",",
"duration",
",",
"postProcess",
",",
"onClose",
",",
"inst",
"=",
"this",
".",
"_curInst",
";",
"if",
"(",
"!",
"inst",
"||",
"(",
"input",
"&&",
"inst",
"!==",
"$",
".",
"data",
"(",
"inp... | /* Hide the date picker from view.
@param input element - the input field attached to the date picker | [
"/",
"*",
"Hide",
"the",
"date",
"picker",
"from",
"view",
"."
] | 38789f6e8bd3d04f7d3b2c3427e509d00f2610fc | https://github.com/Freeboard/freeboard/blob/38789f6e8bd3d04f7d3b2c3427e509d00f2610fc/js/freeboard.thirdparty.js#L8463-L8506 | train | Hide the datepicker | [
30522,
3853,
1006,
7953,
1007,
1063,
13075,
2265,
7088,
2213,
1010,
9367,
1010,
2695,
21572,
9623,
2015,
1010,
2006,
20464,
9232,
1010,
16021,
2102,
1027,
2023,
1012,
1035,
12731,
6657,
3367,
1025,
2065,
1006,
999,
16021,
2102,
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... | |
mui-org/material-ui | docs/src/pages/components/grid-list/AdvancedGridList.js | AdvancedGridList | function AdvancedGridList() {
const classes = useStyles();
return (
<div className={classes.root}>
<GridList cellHeight={200} spacing={1} className={classes.gridList}>
{tileData.map(tile => (
<GridListTile key={tile.img} cols={tile.featured ? 2 : 1} rows={tile.featured ? 2 : 1}>
... | javascript | function AdvancedGridList() {
const classes = useStyles();
return (
<div className={classes.root}>
<GridList cellHeight={200} spacing={1} className={classes.gridList}>
{tileData.map(tile => (
<GridListTile key={tile.img} cols={tile.featured ? 2 : 1} rows={tile.featured ? 2 : 1}>
... | [
"function",
"AdvancedGridList",
"(",
")",
"{",
"const",
"classes",
"=",
"useStyles",
"(",
")",
";",
"return",
"(",
"<",
"div",
"className",
"=",
"{",
"classes",
".",
"root",
"}",
">",
"\n ",
"<",
"GridList",
"cellHeight",
"=",
"{",
"200",
"}",
"sp... | The example data is structured as follows:
import image from 'path/to/image.jpg';
[etc...]
const tileData = [
{
img: image,
title: 'Image',
author: 'author',
featured: true,
},
{
[etc...]
},
]; | [
"The",
"example",
"data",
"is",
"structured",
"as",
"follows",
":"
] | 1555e52367835946382fbf2a8f681de71318915d | https://github.com/mui-org/material-ui/blob/1555e52367835946382fbf2a8f681de71318915d/docs/src/pages/components/grid-list/AdvancedGridList.js#L52-L77 | train | AdvancedGridList - GridList | [
30522,
3853,
3935,
16523,
3593,
9863,
1006,
1007,
1063,
9530,
3367,
4280,
1027,
3594,
27983,
2015,
1006,
1007,
1025,
2709,
1006,
1026,
4487,
2615,
2465,
18442,
1027,
1063,
4280,
1012,
7117,
1065,
1028,
1026,
8370,
9863,
3526,
26036,
13900,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/selenium-remoterunner.js | requireExtensionJs | function requireExtensionJs(sessionId) {
var src = 'scripts/user-extensions.js[' + sessionId + ']';
if (document.getElementById(src) == null) {
var scriptTag = document.createElement('script');
scriptTag.language = 'JavaScript';
scriptTag.type = 'text/javascript';
scriptTag.src =... | javascript | function requireExtensionJs(sessionId) {
var src = 'scripts/user-extensions.js[' + sessionId + ']';
if (document.getElementById(src) == null) {
var scriptTag = document.createElement('script');
scriptTag.language = 'JavaScript';
scriptTag.type = 'text/javascript';
scriptTag.src =... | [
"function",
"requireExtensionJs",
"(",
"sessionId",
")",
"{",
"var",
"src",
"=",
"'scripts/user-extensions.js['",
"+",
"sessionId",
"+",
"']'",
";",
"if",
"(",
"document",
".",
"getElementById",
"(",
"src",
")",
"==",
"null",
")",
"{",
"var",
"scriptTag",
"=... | Adds a script tag referencing a specially-named user extensions "file". The
resource handler for this special file (which won't actually exist) will use
the session ID embedded in its name to retrieve per-session specified user
extension javascript.
@param sessionId | [
"Adds",
"a",
"script",
"tag",
"referencing",
"a",
"specially",
"-",
"named",
"user",
"extensions",
"file",
".",
"The",
"resource",
"handler",
"for",
"this",
"special",
"file",
"(",
"which",
"won",
"t",
"actually",
"exist",
")",
"will",
"use",
"the",
"sessi... | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/selenium-remoterunner.js#L572-L584 | train | Require extension. js | [
30522,
3853,
5478,
10288,
29048,
22578,
1006,
5219,
3593,
1007,
1063,
13075,
5034,
2278,
1027,
1005,
14546,
1013,
5310,
1011,
14305,
1012,
1046,
2015,
1031,
1005,
1009,
5219,
3593,
1009,
1005,
1033,
1005,
1025,
2065,
1006,
6254,
1012,
2131,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
nhn/tui.editor | src/js/extensions/table/tableRenderer.js | createTableHtml | function createTableHtml(renderData) {
const thead = [renderData[0]];
const tbody = renderData.slice(1);
const theadHtml = _createTheadOrTbodyHtml(thead, 'THEAD');
const tbodyHtml = _createTheadOrTbodyHtml(tbody, 'TBODY');
const className = renderData.className ? ` class="${renderData.className}"` : '';
re... | javascript | function createTableHtml(renderData) {
const thead = [renderData[0]];
const tbody = renderData.slice(1);
const theadHtml = _createTheadOrTbodyHtml(thead, 'THEAD');
const tbodyHtml = _createTheadOrTbodyHtml(tbody, 'TBODY');
const className = renderData.className ? ` class="${renderData.className}"` : '';
re... | [
"function",
"createTableHtml",
"(",
"renderData",
")",
"{",
"const",
"thead",
"=",
"[",
"renderData",
"[",
"0",
"]",
"]",
";",
"const",
"tbody",
"=",
"renderData",
".",
"slice",
"(",
"1",
")",
";",
"const",
"theadHtml",
"=",
"_createTheadOrTbodyHtml",
"(",... | Create table html.
@param {Array.<Array.<object>>} renderData - table data for render
@returns {string}
@private | [
"Create",
"table",
"html",
"."
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/table/tableRenderer.js#L51-L59 | train | Creates html for table | [
30522,
3853,
3443,
10880,
11039,
19968,
1006,
17552,
2850,
2696,
1007,
1063,
9530,
3367,
1996,
4215,
1027,
1031,
17552,
2850,
2696,
1031,
1014,
1033,
1033,
1025,
9530,
3367,
26419,
7716,
2100,
1027,
17552,
2850,
2696,
1012,
14704,
1006,
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... |
expressjs/express | examples/view-constructor/github-view.js | GithubView | function GithubView(name, options){
this.name = name;
options = options || {};
this.engine = options.engines[extname(name)];
// "root" is the app.set('views') setting, however
// in your own implementation you could ignore this
this.path = '/' + options.root + '/master/' + name;
} | javascript | function GithubView(name, options){
this.name = name;
options = options || {};
this.engine = options.engines[extname(name)];
// "root" is the app.set('views') setting, however
// in your own implementation you could ignore this
this.path = '/' + options.root + '/master/' + name;
} | [
"function",
"GithubView",
"(",
"name",
",",
"options",
")",
"{",
"this",
".",
"name",
"=",
"name",
";",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"this",
".",
"engine",
"=",
"options",
".",
"engines",
"[",
"extname",
"(",
"name",
")",
"]",
";... | Custom view that fetches and renders
remove github templates. You could
render templates from a database etc. | [
"Custom",
"view",
"that",
"fetches",
"and",
"renders",
"remove",
"github",
"templates",
".",
"You",
"could",
"render",
"templates",
"from",
"a",
"database",
"etc",
"."
] | dc538f6e810bd462c98ee7e6aae24c64d4b1da93 | https://github.com/expressjs/express/blob/dc538f6e810bd462c98ee7e6aae24c64d4b1da93/examples/view-constructor/github-view.js#L21-L28 | train | GithubView constructor. | [
30522,
3853,
21025,
2705,
12083,
8584,
1006,
2171,
1010,
7047,
1007,
1063,
2023,
1012,
2171,
1027,
2171,
1025,
7047,
1027,
7047,
1064,
1064,
1063,
1065,
1025,
2023,
1012,
3194,
1027,
7047,
1012,
5209,
1031,
4654,
2102,
18442,
1006,
2171,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
summernote/summernote | src/js/base/core/dom.js | walkPoint | function walkPoint(startPoint, endPoint, handler, isSkipInnerOffset) {
let point = startPoint;
while (point) {
handler(point);
if (isSamePoint(point, endPoint)) {
break;
}
const isSkipOffset = isSkipInnerOffset &&
startPoint.node !== point.node &&
... | javascript | function walkPoint(startPoint, endPoint, handler, isSkipInnerOffset) {
let point = startPoint;
while (point) {
handler(point);
if (isSamePoint(point, endPoint)) {
break;
}
const isSkipOffset = isSkipInnerOffset &&
startPoint.node !== point.node &&
... | [
"function",
"walkPoint",
"(",
"startPoint",
",",
"endPoint",
",",
"handler",
",",
"isSkipInnerOffset",
")",
"{",
"let",
"point",
"=",
"startPoint",
";",
"while",
"(",
"point",
")",
"{",
"handler",
"(",
"point",
")",
";",
"if",
"(",
"isSamePoint",
"(",
"p... | @method walkPoint
@param {BoundaryPoint} startPoint
@param {BoundaryPoint} endPoint
@param {Function} handler
@param {Boolean} isSkipInnerOffset | [
"@method",
"walkPoint"
] | 8dcafb8107453006b905ef697a529c42e76beb3f | https://github.com/summernote/summernote/blob/8dcafb8107453006b905ef697a529c42e76beb3f/src/js/base/core/dom.js#L677-L692 | train | Walks through the points of a node | [
30522,
3853,
3328,
8400,
1006,
2707,
8400,
1010,
2203,
8400,
1010,
28213,
1010,
26354,
3211,
8091,
3678,
27475,
3388,
1007,
1063,
2292,
2391,
1027,
2707,
8400,
1025,
2096,
1006,
2391,
1007,
1063,
28213,
1006,
2391,
1007,
1025,
2065,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/LiveDevelopment/Agents/RemoteAgent.js | _onAttributeModified | function _onAttributeModified(event, res) {
// res = {nodeId, name, value}
var matches = /^data-ld-(.*)/.exec(res.name);
if (matches) {
exports.trigger(matches[1], res);
}
} | javascript | function _onAttributeModified(event, res) {
// res = {nodeId, name, value}
var matches = /^data-ld-(.*)/.exec(res.name);
if (matches) {
exports.trigger(matches[1], res);
}
} | [
"function",
"_onAttributeModified",
"(",
"event",
",",
"res",
")",
"{",
"// res = {nodeId, name, value}",
"var",
"matches",
"=",
"/",
"^data-ld-(.*)",
"/",
".",
"exec",
"(",
"res",
".",
"name",
")",
";",
"if",
"(",
"matches",
")",
"{",
"exports",
".",
"tri... | interval used to send keepAlive events WebInspector Event: DOM.attributeModified | [
"interval",
"used",
"to",
"send",
"keepAlive",
"events",
"WebInspector",
"Event",
":",
"DOM",
".",
"attributeModified"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/RemoteAgent.js#L47-L53 | train | Called when an attribute is modified | [
30522,
3853,
1035,
2006,
19321,
3089,
8569,
18532,
7716,
7810,
1006,
2724,
1010,
24501,
1007,
1063,
1013,
1013,
24501,
1027,
1063,
13045,
3593,
1010,
2171,
1010,
3643,
1065,
13075,
3503,
1027,
1013,
1034,
2951,
1011,
25510,
1011,
1006,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/command/KeyBindingManager.js | removeGlobalKeydownHook | function removeGlobalKeydownHook(hook) {
var index = _globalKeydownHooks.indexOf(hook);
if (index !== -1) {
_globalKeydownHooks.splice(index, 1);
}
} | javascript | function removeGlobalKeydownHook(hook) {
var index = _globalKeydownHooks.indexOf(hook);
if (index !== -1) {
_globalKeydownHooks.splice(index, 1);
}
} | [
"function",
"removeGlobalKeydownHook",
"(",
"hook",
")",
"{",
"var",
"index",
"=",
"_globalKeydownHooks",
".",
"indexOf",
"(",
"hook",
")",
";",
"if",
"(",
"index",
"!==",
"-",
"1",
")",
"{",
"_globalKeydownHooks",
".",
"splice",
"(",
"index",
",",
"1",
... | Removes a global keydown hook added by `addGlobalKeydownHook`.
Does not need to be the most recently added hook.
@param {function(Event): boolean} hook The global hook to remove. | [
"Removes",
"a",
"global",
"keydown",
"hook",
"added",
"by",
"addGlobalKeydownHook",
".",
"Does",
"not",
"need",
"to",
"be",
"the",
"most",
"recently",
"added",
"hook",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/KeyBindingManager.js#L964-L969 | train | Remove a global keydown hook | [
30522,
3853,
6366,
23296,
16429,
2389,
14839,
7698,
6806,
6559,
1006,
8103,
1007,
1063,
13075,
5950,
1027,
1035,
3795,
14839,
7698,
6806,
6559,
2015,
1012,
5950,
11253,
1006,
8103,
1007,
1025,
2065,
1006,
5950,
999,
1027,
1027,
1011,
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... |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableAccRenderExtension.js | function(oRm, sParentId, sId, sText, aCSSClasses) {
aCSSClasses = aCSSClasses || [];
aCSSClasses.push("sapUiInvisibleText");
oRm.write("<span");
oRm.writeAttribute("id", sParentId + "-" + sId);
oRm.writeAttribute("class", aCSSClasses.join(" "));
oRm.writeAttribute("aria-hidden", "true");
oRm.write(">");
... | javascript | function(oRm, sParentId, sId, sText, aCSSClasses) {
aCSSClasses = aCSSClasses || [];
aCSSClasses.push("sapUiInvisibleText");
oRm.write("<span");
oRm.writeAttribute("id", sParentId + "-" + sId);
oRm.writeAttribute("class", aCSSClasses.join(" "));
oRm.writeAttribute("aria-hidden", "true");
oRm.write(">");
... | [
"function",
"(",
"oRm",
",",
"sParentId",
",",
"sId",
",",
"sText",
",",
"aCSSClasses",
")",
"{",
"aCSSClasses",
"=",
"aCSSClasses",
"||",
"[",
"]",
";",
"aCSSClasses",
".",
"push",
"(",
"\"sapUiInvisibleText\"",
")",
";",
"oRm",
".",
"write",
"(",
"\"<s... | /*
Renders a hidden element with the given id, text and css classes. | [
"/",
"*",
"Renders",
"a",
"hidden",
"element",
"with",
"the",
"given",
"id",
"text",
"and",
"css",
"classes",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableAccRenderExtension.js#L15-L28 | train | Renders the invisible text | [
30522,
3853,
1006,
2030,
2213,
1010,
8622,
16778,
2094,
1010,
15765,
1010,
26261,
18413,
1010,
9353,
4757,
26266,
2229,
1007,
1063,
9353,
4757,
26266,
2229,
1027,
9353,
4757,
26266,
2229,
1064,
1064,
1031,
1033,
1025,
9353,
4757,
26266,
222... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
openlayers/openlayers | tasks/generate-index.js | getSymbols | async function getSymbols() {
const info = await generateInfo();
return info.symbols.filter(symbol => symbol.kind != 'member');
} | javascript | async function getSymbols() {
const info = await generateInfo();
return info.symbols.filter(symbol => symbol.kind != 'member');
} | [
"async",
"function",
"getSymbols",
"(",
")",
"{",
"const",
"info",
"=",
"await",
"generateInfo",
"(",
")",
";",
"return",
"info",
".",
"symbols",
".",
"filter",
"(",
"symbol",
"=>",
"symbol",
".",
"kind",
"!=",
"'member'",
")",
";",
"}"
] | Read the symbols from info file.
@return {Promise<Array>} Resolves with an array of symbol objects. | [
"Read",
"the",
"symbols",
"from",
"info",
"file",
"."
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/tasks/generate-index.js#L10-L13 | train | Get all members of the cluster | [
30522,
2004,
6038,
2278,
3853,
4152,
24335,
14956,
2015,
1006,
1007,
1063,
9530,
3367,
18558,
1027,
26751,
9699,
2378,
14876,
1006,
1007,
1025,
2709,
18558,
1012,
9255,
1012,
11307,
1006,
6454,
1027,
1028,
6454,
1012,
2785,
999,
1027,
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... |
adobe/brackets | src/utils/EventDispatcher.js | markDeprecated | function markDeprecated(obj, eventName, insteadStr) {
// Mark event as deprecated - on() will emit warnings when called with this event
if (!obj._deprecatedEvents) {
obj._deprecatedEvents = {};
}
obj._deprecatedEvents[eventName] = insteadStr || true;
} | javascript | function markDeprecated(obj, eventName, insteadStr) {
// Mark event as deprecated - on() will emit warnings when called with this event
if (!obj._deprecatedEvents) {
obj._deprecatedEvents = {};
}
obj._deprecatedEvents[eventName] = insteadStr || true;
} | [
"function",
"markDeprecated",
"(",
"obj",
",",
"eventName",
",",
"insteadStr",
")",
"{",
"// Mark event as deprecated - on() will emit warnings when called with this event",
"if",
"(",
"!",
"obj",
".",
"_deprecatedEvents",
")",
"{",
"obj",
".",
"_deprecatedEvents",
"=",
... | Mark a given event name as deprecated, such that on() will emit warnings when called with it.
May be called before makeEventDispatcher(). May be called on a prototype where makeEventDispatcher()
is called separately per instance (i.e. in the constructor). Should be called before clients have
a chance to start calling o... | [
"Mark",
"a",
"given",
"event",
"name",
"as",
"deprecated",
"such",
"that",
"on",
"()",
"will",
"emit",
"warnings",
"when",
"called",
"with",
"it",
".",
"May",
"be",
"called",
"before",
"makeEventDispatcher",
"()",
".",
"May",
"be",
"called",
"on",
"a",
"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/EventDispatcher.js#L297-L303 | train | Mark an event as deprecated | [
30522,
3853,
2928,
3207,
28139,
12921,
1006,
27885,
3501,
1010,
2724,
18442,
1010,
2612,
3367,
2099,
1007,
1063,
1013,
1013,
2928,
2724,
2004,
2139,
28139,
12921,
1011,
2006,
1006,
1007,
2097,
12495,
2102,
16234,
2043,
2170,
2007,
2023,
272... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/support/plugins/TechInfo.js | formatBuildInfo | function formatBuildInfo(timestamp, scmRevision) {
var info = [];
if ( timestamp ) {
var match = /^(\d{4})(\d{2})(\d{2})-?(\d{2})(\d{2})$/.exec(timestamp);
if ( match ) {
timestamp = match[1] + '-' + match[2] + '-' + match[3] + 'T' + match[4] + ":" + match[5];
}
info.push("built at " +... | javascript | function formatBuildInfo(timestamp, scmRevision) {
var info = [];
if ( timestamp ) {
var match = /^(\d{4})(\d{2})(\d{2})-?(\d{2})(\d{2})$/.exec(timestamp);
if ( match ) {
timestamp = match[1] + '-' + match[2] + '-' + match[3] + 'T' + match[4] + ":" + match[5];
}
info.push("built at " +... | [
"function",
"formatBuildInfo",
"(",
"timestamp",
",",
"scmRevision",
")",
"{",
"var",
"info",
"=",
"[",
"]",
";",
"if",
"(",
"timestamp",
")",
"{",
"var",
"match",
"=",
"/",
"^(\\d{4})(\\d{2})(\\d{2})-?(\\d{2})(\\d{2})$",
"/",
".",
"exec",
"(",
"timestamp",
... | version information | [
"version",
"information"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/plugins/TechInfo.js#L64-L77 | train | Format build info | [
30522,
3853,
4289,
8569,
4014,
8718,
14876,
1006,
2335,
15464,
2361,
1010,
8040,
2213,
2890,
17084,
1007,
1063,
13075,
18558,
1027,
1031,
1033,
1025,
2065,
1006,
2335,
15464,
2361,
1007,
1063,
13075,
2674,
1027,
1013,
1034,
1006,
1032,
1040... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dcloudio/mui | js/mui.jsonp.js | function(url, data, jsonpParam, callbacnName) {
if (jsonpParam) {
url = url.replace(jsonpParam + '=?', jsonpParam + '=' + callbacnName);
} else {
data['callback'] = callbacnName;
}
var buffer = [];
for (var key in data) {
buffer.push(key + '=' + encodeURIComponent(data[key]));
}
return url + (url... | javascript | function(url, data, jsonpParam, callbacnName) {
if (jsonpParam) {
url = url.replace(jsonpParam + '=?', jsonpParam + '=' + callbacnName);
} else {
data['callback'] = callbacnName;
}
var buffer = [];
for (var key in data) {
buffer.push(key + '=' + encodeURIComponent(data[key]));
}
return url + (url... | [
"function",
"(",
"url",
",",
"data",
",",
"jsonpParam",
",",
"callbacnName",
")",
"{",
"if",
"(",
"jsonpParam",
")",
"{",
"url",
"=",
"url",
".",
"replace",
"(",
"jsonpParam",
"+",
"'=?'",
",",
"jsonpParam",
"+",
"'='",
"+",
"callbacnName",
")",
";",
... | 转换 URL,JSONP 只支持 get 方式的 queryString ,需将 data 拼入 url | [
"转换",
"URL,JSONP",
"只支持",
"get",
"方式的",
"queryString",
"需将",
"data",
"拼入",
"url"
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/js/mui.jsonp.js#L30-L41 | train | Add callback to url | [
30522,
3853,
1006,
24471,
2140,
1010,
2951,
1010,
1046,
3385,
13944,
6444,
1010,
2655,
3676,
2278,
9516,
4168,
1007,
1063,
2065,
1006,
1046,
3385,
13944,
6444,
1007,
1063,
24471,
2140,
1027,
24471,
2140,
1012,
5672,
1006,
1046,
3385,
13944,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
jgraph/mxgraph | javascript/mxClient.js | mxRectangle | function mxRectangle(x, y, width, height)
{
mxPoint.call(this, x, y);
this.width = (width != null) ? width : 0;
this.height = (height != null) ? height : 0;
} | javascript | function mxRectangle(x, y, width, height)
{
mxPoint.call(this, x, y);
this.width = (width != null) ? width : 0;
this.height = (height != null) ? height : 0;
} | [
"function",
"mxRectangle",
"(",
"x",
",",
"y",
",",
"width",
",",
"height",
")",
"{",
"mxPoint",
".",
"call",
"(",
"this",
",",
"x",
",",
"y",
")",
";",
"this",
".",
"width",
"=",
"(",
"width",
"!=",
"null",
")",
"?",
"width",
":",
"0",
";",
... | Copyright (c) 2006-2015, JGraph Ltd
Copyright (c) 2006-2015, Gaudenz Alder
Class: mxRectangle
Extends <mxPoint> to implement a 2-dimensional rectangle with double
precision coordinates.
Constructor: mxRectangle
Constructs a new rectangle for the optional parameters. If no parameters
are given then the respective d... | [
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"JGraph",
"Ltd",
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2015",
"Gaudenz",
"Alder",
"Class",
":",
"mxRectangle"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L1760-L1766 | train | A rectangle is a rectangle of the given size | [
30522,
3853,
25630,
2890,
25572,
3070,
2571,
1006,
1060,
1010,
1061,
1010,
9381,
1010,
4578,
1007,
1063,
25630,
8400,
1012,
2655,
1006,
2023,
1010,
1060,
1010,
1061,
1007,
1025,
2023,
1012,
9381,
1027,
1006,
9381,
999,
1027,
19701,
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... |
adobe/brackets | src/project/FileTreeViewModel.js | _addNewEntries | function _addNewEntries(treeData, added) {
added.forEach(function (filePath) {
var isFolder = _.last(filePath) === "/";
filePath = isFolder ? filePath.substr(0, filePath.length - 1) : filePath;
var parentPath = FileUtils.getDirectoryPath(filePath),
parentObj... | javascript | function _addNewEntries(treeData, added) {
added.forEach(function (filePath) {
var isFolder = _.last(filePath) === "/";
filePath = isFolder ? filePath.substr(0, filePath.length - 1) : filePath;
var parentPath = FileUtils.getDirectoryPath(filePath),
parentObj... | [
"function",
"_addNewEntries",
"(",
"treeData",
",",
"added",
")",
"{",
"added",
".",
"forEach",
"(",
"function",
"(",
"filePath",
")",
"{",
"var",
"isFolder",
"=",
"_",
".",
"last",
"(",
"filePath",
")",
"===",
"\"/\"",
";",
"filePath",
"=",
"isFolder",
... | @private
Adds entries at the paths listed in the `added` array. Directories should have a trailing slash.
@param {Immutable.Map} treeData
@param {Array.<string>} added list of new project-relative file paths
@return {Immutable.Map} revised treeData | [
"@private"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeViewModel.js#L1006-L1032 | train | Add new entries to the treeData | [
30522,
3853,
1035,
5587,
2638,
12449,
21011,
1006,
3392,
2850,
2696,
1010,
2794,
1007,
1063,
2794,
1012,
18921,
6776,
1006,
3853,
1006,
5371,
15069,
1007,
1063,
13075,
2003,
10371,
2121,
1027,
1035,
1012,
2197,
1006,
5371,
15069,
1007,
1027... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
BlackrockDigital/startbootstrap-sb-admin-2 | vendor/chart.js/Chart.js | function() {
var me = this;
var opts = me.options;
var labelOpts = opts.labels;
var globalDefaults = core_defaults.global;
var defaultColor = globalDefaults.defaultColor;
var lineDefault = globalDefaults.elements.line;
var legendWidth = me.width;
var lineWidths = me.lineWidths;
if (opts.display) {
... | javascript | function() {
var me = this;
var opts = me.options;
var labelOpts = opts.labels;
var globalDefaults = core_defaults.global;
var defaultColor = globalDefaults.defaultColor;
var lineDefault = globalDefaults.elements.line;
var legendWidth = me.width;
var lineWidths = me.lineWidths;
if (opts.display) {
... | [
"function",
"(",
")",
"{",
"var",
"me",
"=",
"this",
";",
"var",
"opts",
"=",
"me",
".",
"options",
";",
"var",
"labelOpts",
"=",
"opts",
".",
"labels",
";",
"var",
"globalDefaults",
"=",
"core_defaults",
".",
"global",
";",
"var",
"defaultColor",
"=",... | Actually draw the legend on the canvas | [
"Actually",
"draw",
"the",
"legend",
"on",
"the",
"canvas"
] | ddfaceb4a8e65a41f163e2fdc4eab49384b810a1 | https://github.com/BlackrockDigital/startbootstrap-sb-admin-2/blob/ddfaceb4a8e65a41f163e2fdc4eab49384b810a1/vendor/chart.js/Chart.js#L14010-L14150 | train | draw the legend box | [
30522,
3853,
1006,
1007,
1063,
13075,
2033,
1027,
2023,
1025,
13075,
23569,
2015,
1027,
2033,
1012,
7047,
1025,
13075,
3830,
7361,
3215,
1027,
23569,
2015,
1012,
10873,
1025,
13075,
3795,
3207,
7011,
11314,
2015,
1027,
4563,
1035,
12398,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
GitbookIO/gitbook | lib/output/modifiers/resolveImages.js | resolveImages | function resolveImages(currentFile, $) {
var currentDirectory = path.dirname(currentFile);
return editHTMLElement($, 'img', function($img) {
var src = $img.attr('src');
if (LocationUtils.isExternal(src) || LocationUtils.isDataURI(src)) {
return;
}
// Calcul absolut... | javascript | function resolveImages(currentFile, $) {
var currentDirectory = path.dirname(currentFile);
return editHTMLElement($, 'img', function($img) {
var src = $img.attr('src');
if (LocationUtils.isExternal(src) || LocationUtils.isDataURI(src)) {
return;
}
// Calcul absolut... | [
"function",
"resolveImages",
"(",
"currentFile",
",",
"$",
")",
"{",
"var",
"currentDirectory",
"=",
"path",
".",
"dirname",
"(",
"currentFile",
")",
";",
"return",
"editHTMLElement",
"(",
"$",
",",
"'img'",
",",
"function",
"(",
"$img",
")",
"{",
"var",
... | Resolve all HTML images:
- /test.png in hello -> ../test.html
@param {String} currentFile
@param {HTMLDom} $ | [
"Resolve",
"all",
"HTML",
"images",
":",
"-",
"/",
"test",
".",
"png",
"in",
"hello",
"-",
">",
"..",
"/",
"test",
".",
"html"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/output/modifiers/resolveImages.js#L13-L31 | train | Resolve images from the current file | [
30522,
3853,
10663,
9581,
8449,
1006,
2783,
8873,
2571,
1010,
1002,
1007,
1063,
13075,
2783,
4305,
2890,
16761,
2100,
1027,
4130,
1012,
16101,
18442,
1006,
2783,
8873,
2571,
1007,
1025,
2709,
13257,
21246,
2571,
16930,
4765,
1006,
1002,
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... |
jhipster/generator-jhipster | generators/utils.js | copyWebResource | function copyWebResource(source, dest, regex, type, generator, opt = {}, template) {
if (generator.enableTranslation) {
generator.template(source, dest, generator, opt);
} else {
renderContent(source, generator, generator, opt, body => {
body = body.replace(regex, '');
sw... | javascript | function copyWebResource(source, dest, regex, type, generator, opt = {}, template) {
if (generator.enableTranslation) {
generator.template(source, dest, generator, opt);
} else {
renderContent(source, generator, generator, opt, body => {
body = body.replace(regex, '');
sw... | [
"function",
"copyWebResource",
"(",
"source",
",",
"dest",
",",
"regex",
",",
"type",
",",
"generator",
",",
"opt",
"=",
"{",
"}",
",",
"template",
")",
"{",
"if",
"(",
"generator",
".",
"enableTranslation",
")",
"{",
"generator",
".",
"template",
"(",
... | Copy web resources
@param {string} source source
@param {string} dest destination
@param {regex} regex regex
@param {string} type type of resource (html, js, etc)
@param {object} generator reference to the generator
@param {object} opt options
@param {any} template template | [
"Copy",
"web",
"resources"
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/utils.js#L169-L191 | train | Copy a web resource to a destination | [
30522,
3853,
6100,
8545,
13578,
6499,
3126,
3401,
1006,
3120,
1010,
4078,
2102,
1010,
19723,
10288,
1010,
2828,
1010,
13103,
1010,
23569,
1027,
1063,
1065,
1010,
23561,
1007,
1063,
2065,
1006,
13103,
1012,
9585,
6494,
3619,
13490,
1007,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-js | lib/dynamodb/converter.js | unmarshall | function unmarshall(data, options) {
return AWS.DynamoDB.Converter.output({M: data}, options);
} | javascript | function unmarshall(data, options) {
return AWS.DynamoDB.Converter.output({M: data}, options);
} | [
"function",
"unmarshall",
"(",
"data",
",",
"options",
")",
"{",
"return",
"AWS",
".",
"DynamoDB",
".",
"Converter",
".",
"output",
"(",
"{",
"M",
":",
"data",
"}",
",",
"options",
")",
";",
"}"
] | Convert a DynamoDB record into a JavaScript object.
@param data [any] The DynamoDB record
@param options [map]
@option options convertEmptyValues [Boolean] Whether to automatically
convert empty strings, blobs,
and sets to `null`
@option options wrapNumbers [Boolean] Whether to return numbers as a
NumberValue object ... | [
"Convert",
"a",
"DynamoDB",
"record",
"into",
"a",
"JavaScript",
"object",
"."
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/dynamodb/converter.js#L200-L202 | train | Unmarshalls DynamoDB data into a DynamoDB record sequence | [
30522,
3853,
4895,
7849,
7377,
3363,
1006,
2951,
1010,
7047,
1007,
1063,
2709,
22091,
2015,
1012,
17205,
18939,
1012,
10463,
2121,
1012,
6434,
1006,
1063,
1049,
1024,
2951,
1065,
1010,
7047,
1007,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js | _isLineBreakOrBlockElement | function _isLineBreakOrBlockElement(element) {
if (_isLineBreak(element)) {
return true;
}
if (wysihtml5.dom.getStyle("display").from(element) === "block") {
return true;
}
return false;
} | javascript | function _isLineBreakOrBlockElement(element) {
if (_isLineBreak(element)) {
return true;
}
if (wysihtml5.dom.getStyle("display").from(element) === "block") {
return true;
}
return false;
} | [
"function",
"_isLineBreakOrBlockElement",
"(",
"element",
")",
"{",
"if",
"(",
"_isLineBreak",
"(",
"element",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"wysihtml5",
".",
"dom",
".",
"getStyle",
"(",
"\"display\"",
")",
".",
"from",
"(",
"ele... | Checks whether the elment causes a visual line break
(<br> or block elements) | [
"Checks",
"whether",
"the",
"elment",
"causes",
"a",
"visual",
"line",
"break",
"(",
"<br",
">",
"or",
"block",
"elements",
")"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L5710-L5720 | train | Check if the element is a line break or block element | [
30522,
3853,
1035,
2003,
4179,
23890,
2953,
23467,
12260,
3672,
1006,
5783,
1007,
1063,
2065,
1006,
1035,
2003,
4179,
23890,
1006,
5783,
1007,
1007,
1063,
2709,
2995,
1025,
1065,
2065,
1006,
1059,
7274,
19190,
21246,
2140,
2629,
1012,
14383... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.documentation/src/sap/ui/documentation/sdk/util/DocumentationRouter.js | function (viewName, viewType, master, data) {
var oComponent = this._getOwnerComponent(),
oRootView = oComponent.byId(oComponent.getManifestEntry("/sap.ui5/rootView").id);
oRootView.loaded().then(function (oRootView) {
var oApp = oRootView.byId("splitApp"),
oView = this.getView(viewName, viewType);
... | javascript | function (viewName, viewType, master, data) {
var oComponent = this._getOwnerComponent(),
oRootView = oComponent.byId(oComponent.getManifestEntry("/sap.ui5/rootView").id);
oRootView.loaded().then(function (oRootView) {
var oApp = oRootView.byId("splitApp"),
oView = this.getView(viewName, viewType);
... | [
"function",
"(",
"viewName",
",",
"viewType",
",",
"master",
",",
"data",
")",
"{",
"var",
"oComponent",
"=",
"this",
".",
"_getOwnerComponent",
"(",
")",
",",
"oRootView",
"=",
"oComponent",
".",
"byId",
"(",
"oComponent",
".",
"getManifestEntry",
"(",
"\... | a nav to method that does not write hashes but load the views properly | [
"a",
"nav",
"to",
"method",
"that",
"does",
"not",
"write",
"hashes",
"but",
"load",
"the",
"views",
"properly"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/util/DocumentationRouter.js#L140-L151 | train | Add a new page to the detail | [
30522,
3853,
1006,
3193,
18442,
1010,
3193,
13874,
1010,
3040,
1010,
2951,
1007,
1063,
13075,
1051,
9006,
29513,
3372,
1027,
2023,
1012,
1035,
2131,
12384,
2121,
9006,
29513,
3372,
1006,
1007,
1010,
20298,
4140,
8584,
1027,
1051,
9006,
2951... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
juliangarnier/anime | src/index.js | normalizePropertyTweens | function normalizePropertyTweens(prop, tweenSettings) {
let settings = cloneObject(tweenSettings);
// Override duration if easing is a spring
if (/^spring/.test(settings.easing)) settings.duration = spring(settings.easing);
if (is.arr(prop)) {
const l = prop.length;
const isFromTo = (l === 2 && !is.obj(... | javascript | function normalizePropertyTweens(prop, tweenSettings) {
let settings = cloneObject(tweenSettings);
// Override duration if easing is a spring
if (/^spring/.test(settings.easing)) settings.duration = spring(settings.easing);
if (is.arr(prop)) {
const l = prop.length;
const isFromTo = (l === 2 && !is.obj(... | [
"function",
"normalizePropertyTweens",
"(",
"prop",
",",
"tweenSettings",
")",
"{",
"let",
"settings",
"=",
"cloneObject",
"(",
"tweenSettings",
")",
";",
"// Override duration if easing is a spring",
"if",
"(",
"/",
"^spring",
"/",
".",
"test",
"(",
"settings",
"... | Properties | [
"Properties"
] | 875a3d6745d4bff2e4c6ffe0e2d24aac3bf8a45a | https://github.com/juliangarnier/anime/blob/875a3d6745d4bff2e4c6ffe0e2d24aac3bf8a45a/src/index.js#L653-L677 | train | Normalizes a property s tween values into a tween object | [
30522,
3853,
3671,
4697,
21572,
4842,
3723,
2102,
28394,
3619,
1006,
17678,
1010,
1056,
28394,
12325,
13027,
2015,
1007,
1063,
2292,
10906,
1027,
17598,
16429,
20614,
1006,
1056,
28394,
12325,
13027,
2015,
1007,
1025,
1013,
1013,
2058,
15637,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cytoscape/cytoscape.js | dist/cytoscape.esm.js | updateAncestorsInDragLayer | function updateAncestorsInDragLayer(node, opts) {
if (opts.inDragLayer == null && opts.addToList == null) {
return;
} // nothing to do
if (!node.cy().hasCompoundNodes()) {
return;
} // find top-level parent
var parent = node.ancestors().orphans(); // no parent node: no nodes to add t... | javascript | function updateAncestorsInDragLayer(node, opts) {
if (opts.inDragLayer == null && opts.addToList == null) {
return;
} // nothing to do
if (!node.cy().hasCompoundNodes()) {
return;
} // find top-level parent
var parent = node.ancestors().orphans(); // no parent node: no nodes to add t... | [
"function",
"updateAncestorsInDragLayer",
"(",
"node",
",",
"opts",
")",
"{",
"if",
"(",
"opts",
".",
"inDragLayer",
"==",
"null",
"&&",
"opts",
".",
"addToList",
"==",
"null",
")",
"{",
"return",
";",
"}",
"// nothing to do",
"if",
"(",
"!",
"node",
"."... | helper function to determine which ancestor nodes and edges should go to the drag layer (or should be removed from drag layer). | [
"helper",
"function",
"to",
"determine",
"which",
"ancestor",
"nodes",
"and",
"edges",
"should",
"go",
"to",
"the",
"drag",
"layer",
"(",
"or",
"should",
"be",
"removed",
"from",
"drag",
"layer",
")",
"."
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L23351-L23381 | train | update the ancestors of a node in the drag layer | [
30522,
3853,
10651,
26755,
6591,
22254,
29181,
24314,
1006,
13045,
1010,
23569,
2015,
1007,
1063,
2065,
1006,
23569,
2015,
1012,
27427,
29181,
24314,
1027,
1027,
19701,
1004,
1004,
23569,
2015,
1012,
5587,
3406,
9863,
1027,
1027,
19701,
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... |
GitbookIO/gitbook | lib/output/preparePages.js | preparePages | function preparePages(output) {
var book = output.getBook();
var logger = book.getLogger();
if (book.isMultilingual()) {
return Promise(output);
}
return Parse.parsePagesList(book)
.then(function(pages) {
logger.info.ln('found', pages.size, 'pages');
return output.set(... | javascript | function preparePages(output) {
var book = output.getBook();
var logger = book.getLogger();
if (book.isMultilingual()) {
return Promise(output);
}
return Parse.parsePagesList(book)
.then(function(pages) {
logger.info.ln('found', pages.size, 'pages');
return output.set(... | [
"function",
"preparePages",
"(",
"output",
")",
"{",
"var",
"book",
"=",
"output",
".",
"getBook",
"(",
")",
";",
"var",
"logger",
"=",
"book",
".",
"getLogger",
"(",
")",
";",
"if",
"(",
"book",
".",
"isMultilingual",
"(",
")",
")",
"{",
"return",
... | List and prepare all pages
@param {Output}
@return {Promise<Output>} | [
"List",
"and",
"prepare",
"all",
"pages"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/output/preparePages.js#L10-L24 | train | Prepare pages for a new language | [
30522,
3853,
7374,
13704,
2015,
1006,
6434,
1007,
1063,
13075,
2338,
1027,
6434,
1012,
2131,
8654,
1006,
1007,
1025,
13075,
30524,
2059,
1006,
3853,
1006,
5530,
1007,
1063,
8833,
4590,
1012,
18558,
1012,
1048,
2078,
1006,
1005,
2179,
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... |
SAP/openui5 | src/sap.ui.fl/src/sap/ui/fl/Utils.js | function () {
var oUriParams = this._getUriParameters();
var sDebugParameters = oUriParams.get("sap-ui-debug") || "";
// true if SAPUI5 is in complete debug mode
if (sap.ui.getCore().getConfiguration().getDebug() || sDebugParameters === "true") {
return true;
}
var aDebugParameters = sDebugParam... | javascript | function () {
var oUriParams = this._getUriParameters();
var sDebugParameters = oUriParams.get("sap-ui-debug") || "";
// true if SAPUI5 is in complete debug mode
if (sap.ui.getCore().getConfiguration().getDebug() || sDebugParameters === "true") {
return true;
}
var aDebugParameters = sDebugParam... | [
"function",
"(",
")",
"{",
"var",
"oUriParams",
"=",
"this",
".",
"_getUriParameters",
"(",
")",
";",
"var",
"sDebugParameters",
"=",
"oUriParams",
".",
"get",
"(",
"\"sap-ui-debug\"",
")",
"||",
"\"\"",
";",
"// true if SAPUI5 is in complete debug mode",
"if",
... | Checks the SAPUI5 debug settings to determine whether all or at least the <code>sap.ui.fl</code> library is debugged.
@returns {boolean} Returns a flag if the flexibility library is debugged
@public | [
"Checks",
"the",
"SAPUI5",
"debug",
"settings",
"to",
"determine",
"whether",
"all",
"or",
"at",
"least",
"the",
"<code",
">",
"sap",
".",
"ui",
".",
"fl<",
"/",
"code",
">",
"library",
"is",
"debugged",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/Utils.js#L939-L950 | train | Returns true if the URI parameters are valid | [
30522,
3853,
1006,
1007,
1063,
13075,
2256,
11514,
5400,
5244,
1027,
2023,
1012,
1035,
2131,
9496,
28689,
22828,
2015,
1006,
1007,
1025,
13075,
17371,
15878,
15916,
28689,
22828,
2015,
1027,
2256,
11514,
5400,
5244,
1012,
2131,
1006,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/language/CSSUtils.js | _hasStream | function _hasStream() {
while (stream.eol()) {
line++;
if (line >= lineCount) {
return false;
}
if (_hasNonWhitespace(currentSelector)) {
// If we are in a current selector and starting a newline,
... | javascript | function _hasStream() {
while (stream.eol()) {
line++;
if (line >= lineCount) {
return false;
}
if (_hasNonWhitespace(currentSelector)) {
// If we are in a current selector and starting a newline,
... | [
"function",
"_hasStream",
"(",
")",
"{",
"while",
"(",
"stream",
".",
"eol",
"(",
")",
")",
"{",
"line",
"++",
";",
"if",
"(",
"line",
">=",
"lineCount",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"_hasNonWhitespace",
"(",
"currentSelector",
"... | implement _firstToken()/_nextToken() methods to provide a single stream of tokens | [
"implement",
"_firstToken",
"()",
"/",
"_nextToken",
"()",
"methods",
"to",
"provide",
"a",
"single",
"stream",
"of",
"tokens"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CSSUtils.js#L756-L770 | train | Check if the current selector has a stream | [
30522,
3853,
1035,
2038,
21422,
1006,
1007,
1063,
2096,
1006,
5460,
1012,
1041,
4747,
1006,
1007,
1007,
1063,
2240,
30524,
3597,
16671,
1007,
1063,
2709,
6270,
1025,
1065,
2065,
1006,
1035,
8440,
2239,
2860,
16584,
2229,
15327,
1006,
14731,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/CloseOthers/main.js | getPreferences | function getPreferences() {
// It's senseless to look prefs up for the current file, instead look them up for
// the current project (or globally)
return {
closeBelow : prefs.get("below", PreferencesManager.CURRENT_PROJECT),
closeOthers : prefs.get("others", Preferences... | javascript | function getPreferences() {
// It's senseless to look prefs up for the current file, instead look them up for
// the current project (or globally)
return {
closeBelow : prefs.get("below", PreferencesManager.CURRENT_PROJECT),
closeOthers : prefs.get("others", Preferences... | [
"function",
"getPreferences",
"(",
")",
"{",
"// It's senseless to look prefs up for the current file, instead look them up for",
"// the current project (or globally)",
"return",
"{",
"closeBelow",
":",
"prefs",
".",
"get",
"(",
"\"below\"",
",",
"PreferencesManager",
".",
"CU... | Returns the preferences used to add/remove the menu items
@return {{closeBelow: boolean, closeOthers: boolean, closeAbove: boolean}} | [
"Returns",
"the",
"preferences",
"used",
"to",
"add",
"/",
"remove",
"the",
"menu",
"items"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CloseOthers/main.js#L111-L119 | train | Get the preferences for the current project | [
30522,
3853,
2131,
28139,
25523,
2015,
1006,
1007,
1063,
1013,
1013,
2009,
1005,
1055,
3168,
3238,
2000,
2298,
3653,
10343,
2039,
2005,
1996,
2783,
5371,
1010,
2612,
2298,
2068,
2039,
2005,
1013,
1013,
1996,
2783,
2622,
1006,
2030,
16452,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
graphql/graphql-js | resources/benchmark.js | hashForRevision | function hashForRevision(revision) {
const out = execSync(`git rev-parse "${revision}"`, { encoding: 'utf8' });
const match = /[0-9a-f]{8,40}/.exec(out);
if (!match) {
throw new Error(`Bad results for revision ${revision}: ${out}`);
}
return match[0];
} | javascript | function hashForRevision(revision) {
const out = execSync(`git rev-parse "${revision}"`, { encoding: 'utf8' });
const match = /[0-9a-f]{8,40}/.exec(out);
if (!match) {
throw new Error(`Bad results for revision ${revision}: ${out}`);
}
return match[0];
} | [
"function",
"hashForRevision",
"(",
"revision",
")",
"{",
"const",
"out",
"=",
"execSync",
"(",
"`",
"${",
"revision",
"}",
"`",
",",
"{",
"encoding",
":",
"'utf8'",
"}",
")",
";",
"const",
"match",
"=",
"/",
"[0-9a-f]{8,40}",
"/",
".",
"exec",
"(",
... | Returns the complete git hash for a given git revision reference. | [
"Returns",
"the",
"complete",
"git",
"hash",
"for",
"a",
"given",
"git",
"revision",
"reference",
"."
] | b65ff6db8893c1c68f0f236c4b2d663e6c55f5ef | https://github.com/graphql/graphql-js/blob/b65ff6db8893c1c68f0f236c4b2d663e6c55f5ef/resources/benchmark.js#L37-L44 | train | Returns the hash of a given revision | [
30522,
3853,
23325,
29278,
2890,
17084,
1006,
13921,
1007,
1063,
9530,
3367,
2041,
1027,
4654,
8586,
6508,
12273,
1006,
1036,
21025,
2102,
7065,
1011,
11968,
3366,
1000,
1002,
1063,
30524,
1014,
1011,
1023,
2050,
1011,
1042,
1033,
1063,
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... |
firebase/firebase-js-sdk | packages/auth/demo/public/script.js | onLinkWithEmailAndPassword | function onLinkWithEmailAndPassword() {
var email = $('#link-email').val();
var password = $('#link-password').val();
activeUser().linkWithCredential(
firebase.auth.EmailAuthProvider.credential(email, password))
.then(onAuthUserCredentialSuccess, onAuthError);
} | javascript | function onLinkWithEmailAndPassword() {
var email = $('#link-email').val();
var password = $('#link-password').val();
activeUser().linkWithCredential(
firebase.auth.EmailAuthProvider.credential(email, password))
.then(onAuthUserCredentialSuccess, onAuthError);
} | [
"function",
"onLinkWithEmailAndPassword",
"(",
")",
"{",
"var",
"email",
"=",
"$",
"(",
"'#link-email'",
")",
".",
"val",
"(",
")",
";",
"var",
"password",
"=",
"$",
"(",
"'#link-password'",
")",
".",
"val",
"(",
")",
";",
"activeUser",
"(",
")",
".",
... | Links a signed in user with an email and password account. | [
"Links",
"a",
"signed",
"in",
"user",
"with",
"an",
"email",
"and",
"password",
"account",
"."
] | 491598a499813dacc23724de5e237ec220cc560e | https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/auth/demo/public/script.js#L748-L754 | train | Link with email and password | [
30522,
3853,
2006,
13767,
24415,
14545,
11733,
4859,
15194,
18351,
1006,
1007,
1063,
13075,
10373,
1027,
1002,
1006,
1005,
1001,
4957,
1011,
10373,
1005,
1007,
1012,
11748,
1006,
1007,
1025,
13075,
20786,
1027,
1002,
1006,
1005,
1001,
4957,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/jszip.js | function(path) {
if (path.slice(-1) == '/') {
path = path.substring(0, path.length - 1);
}
var lastSlash = path.lastIndexOf('/');
return (lastSlash > 0) ? path.substring(0, lastSlash) : "";
} | javascript | function(path) {
if (path.slice(-1) == '/') {
path = path.substring(0, path.length - 1);
}
var lastSlash = path.lastIndexOf('/');
return (lastSlash > 0) ? path.substring(0, lastSlash) : "";
} | [
"function",
"(",
"path",
")",
"{",
"if",
"(",
"path",
".",
"slice",
"(",
"-",
"1",
")",
"==",
"'/'",
")",
"{",
"path",
"=",
"path",
".",
"substring",
"(",
"0",
",",
"path",
".",
"length",
"-",
"1",
")",
";",
"}",
"var",
"lastSlash",
"=",
"pat... | Find the parent folder of the path.
@private
@param {string} path the path to use
@return {string} the parent folder, or "" | [
"Find",
"the",
"parent",
"folder",
"of",
"the",
"path",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/jszip.js#L612-L618 | train | Get the taxonomy from the path | [
30522,
3853,
1006,
4130,
1007,
1063,
2065,
1006,
4130,
1012,
14704,
1006,
1011,
1015,
1007,
1027,
1027,
1005,
1013,
1005,
1007,
1063,
4130,
1027,
4130,
1012,
4942,
3367,
4892,
1006,
1014,
1010,
4130,
1012,
3091,
1011,
1015,
1007,
1025,
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... | |
PrismJS/prism | plugins/previewers/prism-previewers.js | function(gradient) {
if (cache[gradient]) {
return cache[gradient];
}
var parts = gradient.match(/^(\b|\B-[a-z]{1,10}-)((?:repeating-)?(?:linear|radial)-gradient)/);
// "", "-moz-", etc.
var prefix = parts && parts[1];
// "linear-gradient", "radial-gradient", etc.
var func = par... | javascript | function(gradient) {
if (cache[gradient]) {
return cache[gradient];
}
var parts = gradient.match(/^(\b|\B-[a-z]{1,10}-)((?:repeating-)?(?:linear|radial)-gradient)/);
// "", "-moz-", etc.
var prefix = parts && parts[1];
// "linear-gradient", "radial-gradient", etc.
var func = par... | [
"function",
"(",
"gradient",
")",
"{",
"if",
"(",
"cache",
"[",
"gradient",
"]",
")",
"{",
"return",
"cache",
"[",
"gradient",
"]",
";",
"}",
"var",
"parts",
"=",
"gradient",
".",
"match",
"(",
"/",
"^(\\b|\\B-[a-z]{1,10}-)((?:repeating-)?(?:linear|radial)-gra... | Converts a gradient to a W3C-valid one
Does not support old webkit syntax (-webkit-gradient(linear...) and -webkit-gradient(radial...))
@param {string} gradient The CSS gradient | [
"Converts",
"a",
"gradient",
"to",
"a",
"W3C",
"-",
"valid",
"one",
"Does",
"not",
"support",
"old",
"webkit",
"syntax",
"(",
"-",
"webkit",
"-",
"gradient",
"(",
"linear",
"...",
")",
"and",
"-",
"webkit",
"-",
"gradient",
"(",
"radial",
"...",
"))"
] | acceb3b56f0e8362a7ef274dbd85b17611df2ec4 | https://github.com/PrismJS/prism/blob/acceb3b56f0e8362a7ef274dbd85b17611df2ec4/plugins/previewers/prism-previewers.js#L116-L134 | train | Converts gradient string to W3C gradient function | [
30522,
3853,
1006,
17978,
1007,
1063,
2065,
1006,
17053,
1031,
17978,
1033,
1007,
1063,
2709,
17053,
1031,
17978,
1033,
1025,
1065,
13075,
3033,
1027,
17978,
1012,
2674,
1006,
1013,
1034,
1006,
1032,
1038,
1064,
1032,
1038,
1011,
1031,
1037... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/HealthLogger.js | setProjectDetail | function setProjectDetail(projectName, numFiles, cacheSize) {
var projectNameHash = StringUtils.hashCode(projectName),
FIFLog = getHealthDataLog("ProjectDetails");
if (!FIFLog) {
FIFLog = {};
}
FIFLog["prj" + projectNameHash] = {
numFiles : numFiles,
... | javascript | function setProjectDetail(projectName, numFiles, cacheSize) {
var projectNameHash = StringUtils.hashCode(projectName),
FIFLog = getHealthDataLog("ProjectDetails");
if (!FIFLog) {
FIFLog = {};
}
FIFLog["prj" + projectNameHash] = {
numFiles : numFiles,
... | [
"function",
"setProjectDetail",
"(",
"projectName",
",",
"numFiles",
",",
"cacheSize",
")",
"{",
"var",
"projectNameHash",
"=",
"StringUtils",
".",
"hashCode",
"(",
"projectName",
")",
",",
"FIFLog",
"=",
"getHealthDataLog",
"(",
"\"ProjectDetails\"",
")",
";",
... | Sets the project details(a probably unique prjID, number of files in the project and the node cache size) in the health log
The name of the project is never saved into the health data log, only the hash(name) is for privacy requirements.
@param {string} projectName The name of the project
@param {number} numFiles Th... | [
"Sets",
"the",
"project",
"details",
"(",
"a",
"probably",
"unique",
"prjID",
"number",
"of",
"files",
"in",
"the",
"project",
"and",
"the",
"node",
"cache",
"size",
")",
"in",
"the",
"health",
"log",
"The",
"name",
"of",
"the",
"project",
"is",
"never",... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/HealthLogger.js#L277-L288 | train | Set project details | [
30522,
3853,
2275,
21572,
20614,
3207,
14162,
1006,
2622,
18442,
1010,
16371,
2213,
8873,
4244,
1010,
17053,
5332,
4371,
1007,
1063,
13075,
2622,
18442,
14949,
2232,
1027,
5164,
21823,
4877,
1012,
23325,
16044,
1006,
2622,
18442,
1007,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/ODataListBinding.js | getSingleFilterValue | function getSingleFilterValue(oFilter, sEdmType, bWithinAnd) {
var sFilter,
sValue = _Helper.formatLiteral(oFilter.oValue1, sEdmType),
sFilterPath = decodeURIComponent(oFilter.sPath);
switch (oFilter.sOperator) {
case FilterOperator.BT :
sFilter = sFilterPath + " ge " + sValue + " and " + sFilte... | javascript | function getSingleFilterValue(oFilter, sEdmType, bWithinAnd) {
var sFilter,
sValue = _Helper.formatLiteral(oFilter.oValue1, sEdmType),
sFilterPath = decodeURIComponent(oFilter.sPath);
switch (oFilter.sOperator) {
case FilterOperator.BT :
sFilter = sFilterPath + " ge " + sValue + " and " + sFilte... | [
"function",
"getSingleFilterValue",
"(",
"oFilter",
",",
"sEdmType",
",",
"bWithinAnd",
")",
"{",
"var",
"sFilter",
",",
"sValue",
"=",
"_Helper",
".",
"formatLiteral",
"(",
"oFilter",
".",
"oValue1",
",",
"sEdmType",
")",
",",
"sFilterPath",
"=",
"decodeURICo... | Returns the $filter value for the given single filter using the given Edm type to
format the filter's operand(s).
@param {sap.ui.model.Filter} oFilter The filter
@param {string} sEdmType The Edm type
@param {boolean} bWithinAnd Whether the embedding filter is an 'and'
@returns {string} The $filter value | [
"Returns",
"the",
"$filter",
"value",
"for",
"the",
"given",
"single",
"filter",
"using",
"the",
"given",
"Edm",
"type",
"to",
"format",
"the",
"filter",
"s",
"operand",
"(",
"s",
")",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/ODataListBinding.js#L869-L904 | train | Get single filter value | [
30522,
3853,
4152,
2075,
2571,
8873,
21928,
10175,
5657,
1006,
1997,
4014,
3334,
1010,
7367,
22117,
13874,
1010,
1038,
24415,
3981,
4859,
1007,
1063,
13075,
16420,
4014,
3334,
1010,
17917,
2389,
5657,
1027,
1035,
2393,
2121,
1012,
4289,
227... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/_ODataMetaModelUtils.js | function (oNavigationProperty, oEntitySet) {
var oNavigationRestrictions =
oEntitySet["Org.OData.Capabilities.V1.NavigationRestrictions"] || {};
oNavigationRestrictions.RestrictedProperties =
oNavigationRestrictions.RestrictedProperties || [];
oNavigationRestrictions.RestrictedProperties.push({
... | javascript | function (oNavigationProperty, oEntitySet) {
var oNavigationRestrictions =
oEntitySet["Org.OData.Capabilities.V1.NavigationRestrictions"] || {};
oNavigationRestrictions.RestrictedProperties =
oNavigationRestrictions.RestrictedProperties || [];
oNavigationRestrictions.RestrictedProperties.push({
... | [
"function",
"(",
"oNavigationProperty",
",",
"oEntitySet",
")",
"{",
"var",
"oNavigationRestrictions",
"=",
"oEntitySet",
"[",
"\"Org.OData.Capabilities.V1.NavigationRestrictions\"",
"]",
"||",
"{",
"}",
";",
"oNavigationRestrictions",
".",
"RestrictedProperties",
"=",
"o... | Adds a V4 navigation restriction annotation with a filter restriction to the given entity
set for the given navigation property with the V2 annotation
<code>sap:filterable="false"</code>.
@param {object} oNavigationProperty
the navigation property of the entity with the V2 annotation
<code>sap:filterable="false"</code... | [
"Adds",
"a",
"V4",
"navigation",
"restriction",
"annotation",
"with",
"a",
"filter",
"restriction",
"to",
"the",
"given",
"entity",
"set",
"for",
"the",
"given",
"navigation",
"property",
"with",
"the",
"V2",
"annotation",
"<code",
">",
"sap",
":",
"filterable... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_ODataMetaModelUtils.js#L240-L258 | train | Adds a restricted property to the entity set | [
30522,
3853,
1006,
2006,
18891,
12540,
21572,
4842,
3723,
1010,
1051,
4765,
3012,
13462,
1007,
1063,
13075,
2006,
18891,
12540,
28533,
7277,
9285,
1027,
1051,
4765,
3012,
13462,
1031,
1000,
8917,
1012,
1051,
2850,
2696,
1012,
9859,
1012,
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... | |
adobe/brackets | src/command/KeyBindingManager.js | _handleKey | function _handleKey(key) {
if (_enabled && _keyMap[key]) {
// The execute() function returns a promise because some commands are async.
// Generally, commands decide whether they can run or not synchronously,
// and reject immediately, so we can test for that synchronously.
... | javascript | function _handleKey(key) {
if (_enabled && _keyMap[key]) {
// The execute() function returns a promise because some commands are async.
// Generally, commands decide whether they can run or not synchronously,
// and reject immediately, so we can test for that synchronously.
... | [
"function",
"_handleKey",
"(",
"key",
")",
"{",
"if",
"(",
"_enabled",
"&&",
"_keyMap",
"[",
"key",
"]",
")",
"{",
"// The execute() function returns a promise because some commands are async.",
"// Generally, commands decide whether they can run or not synchronously,",
"// and r... | Process the keybinding for the current key.
@param {string} A key-description string.
@return {boolean} true if the key was processed, false otherwise | [
"Process",
"the",
"keybinding",
"for",
"the",
"current",
"key",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/KeyBindingManager.js#L811-L820 | train | Handle a key | [
30522,
3853,
1035,
5047,
14839,
1006,
3145,
1007,
1063,
2065,
1006,
1035,
9124,
1004,
1004,
1035,
3145,
2863,
2361,
1031,
3145,
1033,
1007,
1063,
1013,
1013,
1996,
15389,
1006,
1007,
3853,
5651,
1037,
4872,
2138,
2070,
10954,
2024,
2004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/RecentProjects/main.js | selectNextItem | function selectNextItem(direction) {
var $links = $dropdown.find("a"),
index = $dropdownItem ? $links.index($dropdownItem) : (direction > 0 ? -1 : 0),
$newItem = $links.eq((index + direction) % $links.length);
if ($dropdownItem) {
$dropdownItem.removeClass("sele... | javascript | function selectNextItem(direction) {
var $links = $dropdown.find("a"),
index = $dropdownItem ? $links.index($dropdownItem) : (direction > 0 ? -1 : 0),
$newItem = $links.eq((index + direction) % $links.length);
if ($dropdownItem) {
$dropdownItem.removeClass("sele... | [
"function",
"selectNextItem",
"(",
"direction",
")",
"{",
"var",
"$links",
"=",
"$dropdown",
".",
"find",
"(",
"\"a\"",
")",
",",
"index",
"=",
"$dropdownItem",
"?",
"$links",
".",
"index",
"(",
"$dropdownItem",
")",
":",
"(",
"direction",
">",
"0",
"?",... | Selects the next or previous item in the list
@param {number} direction +1 for next, -1 for prev | [
"Selects",
"the",
"next",
"or",
"previous",
"item",
"in",
"the",
"list"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RecentProjects/main.js#L162-L174 | train | select next item | [
30522,
3853,
7276,
2638,
18413,
4221,
2213,
1006,
3257,
1007,
1063,
13075,
1002,
6971,
1027,
1002,
4530,
7698,
1012,
2424,
1006,
1000,
1037,
1000,
1007,
1010,
5950,
1027,
1002,
4530,
7698,
4221,
2213,
1029,
1002,
6971,
1012,
5950,
1006,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
heyui/heyui | src/plugins/popper/index.js | disableEventListeners | function disableEventListeners() {
if (this.state.eventsEnabled) {
if (window.cancelAnimationFrame) {
cancelAnimationFrame(this.scheduleUpdate);
}
this.state = removeEventListeners(this.reference, this.state);
}
} | javascript | function disableEventListeners() {
if (this.state.eventsEnabled) {
if (window.cancelAnimationFrame) {
cancelAnimationFrame(this.scheduleUpdate);
}
this.state = removeEventListeners(this.reference, this.state);
}
} | [
"function",
"disableEventListeners",
"(",
")",
"{",
"if",
"(",
"this",
".",
"state",
".",
"eventsEnabled",
")",
"{",
"if",
"(",
"window",
".",
"cancelAnimationFrame",
")",
"{",
"cancelAnimationFrame",
"(",
"this",
".",
"scheduleUpdate",
")",
";",
"}",
"this"... | It will remove resize/scroll events and won't recalculate popper position
when they are triggered. It also won't trigger onUpdate callback anymore,
unless you call `update` method manually.
@method
@memberof Popper | [
"It",
"will",
"remove",
"resize",
"/",
"scroll",
"events",
"and",
"won",
"t",
"recalculate",
"popper",
"position",
"when",
"they",
"are",
"triggered",
".",
"It",
"also",
"won",
"t",
"trigger",
"onUpdate",
"callback",
"anymore",
"unless",
"you",
"call",
"upda... | d5405d27d994151b676eb91c12b389316d7f6679 | https://github.com/heyui/heyui/blob/d5405d27d994151b676eb91c12b389316d7f6679/src/plugins/popper/index.js#L1145-L1152 | train | Disable event listeners | [
30522,
3853,
4487,
19150,
18697,
3372,
9863,
24454,
2015,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
2110,
1012,
2824,
8189,
23242,
1007,
1063,
2065,
1006,
3332,
1012,
17542,
7088,
28649,
15643,
1007,
1063,
17542,
7088,
28649,
15643,
1006,
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... |
SeleniumHQ/selenium | third_party/closure/goog/i18n/dateintervalformat.js | function(
firstPattern, secondPattern, dateTimeSymbols, useFirstDateOnFirstPattern) {
/**
* Formatter_ to format the first part of the date interval.
* @private {!DateTimeFormat}
*/
this.firstPartFormatter_ = new DateTimeFormat(firstPattern, dateTimeSymbols);
/**
* Formatter_ to format the second... | javascript | function(
firstPattern, secondPattern, dateTimeSymbols, useFirstDateOnFirstPattern) {
/**
* Formatter_ to format the first part of the date interval.
* @private {!DateTimeFormat}
*/
this.firstPartFormatter_ = new DateTimeFormat(firstPattern, dateTimeSymbols);
/**
* Formatter_ to format the second... | [
"function",
"(",
"firstPattern",
",",
"secondPattern",
",",
"dateTimeSymbols",
",",
"useFirstDateOnFirstPattern",
")",
"{",
"/**\n * Formatter_ to format the first part of the date interval.\n * @private {!DateTimeFormat}\n */",
"this",
".",
"firstPartFormatter_",
"=",
"new",
... | Constructs an IntervalFormatter_ object which implements the Formatter_
interface.
Internal object to construct and store a goog.i18n.DateTimeFormat for each
part of the date interval pattern.
@param {string} firstPattern First part of the date interval pattern.
@param {string} secondPattern Second part of the date i... | [
"Constructs",
"an",
"IntervalFormatter_",
"object",
"which",
"implements",
"the",
"Formatter_",
"interface",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/closure/goog/i18n/dateintervalformat.js#L556-L577 | train | A formatter for the date interval. | [
30522,
3853,
1006,
2034,
4502,
12079,
2078,
1010,
2117,
4502,
12079,
2078,
1010,
3058,
7292,
6508,
13344,
4877,
1010,
2224,
8873,
12096,
13701,
2239,
8873,
12096,
4502,
12079,
2078,
1007,
1063,
1013,
1008,
1008,
1008,
4289,
3334,
1035,
2000... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/LocaleData.js | function(sNumber) {
var oPlurals = this._get("plurals");
if (typeof sNumber === "number") {
sNumber = sNumber.toString();
}
if (!this._pluralTest) {
this._pluralTest = {};
}
for (var sCategory in oPlurals) {
var fnTest = this._pluralTest[sCategory];
if (!fnTest) {
fnTest = this._p... | javascript | function(sNumber) {
var oPlurals = this._get("plurals");
if (typeof sNumber === "number") {
sNumber = sNumber.toString();
}
if (!this._pluralTest) {
this._pluralTest = {};
}
for (var sCategory in oPlurals) {
var fnTest = this._pluralTest[sCategory];
if (!fnTest) {
fnTest = this._p... | [
"function",
"(",
"sNumber",
")",
"{",
"var",
"oPlurals",
"=",
"this",
".",
"_get",
"(",
"\"plurals\"",
")",
";",
"if",
"(",
"typeof",
"sNumber",
"===",
"\"number\"",
")",
"{",
"sNumber",
"=",
"sNumber",
".",
"toString",
"(",
")",
";",
"}",
"if",
"(",... | Returns the plural category (zero, one, two, few, many or other) for the given number value.
The number should be passed as a string with dot as decimal separator and the number of decimal/fraction digits
as used in the final output. This is needed in order to preserve trailing zeros which are relevant to
determine the... | [
"Returns",
"the",
"plural",
"category",
"(",
"zero",
"one",
"two",
"few",
"many",
"or",
"other",
")",
"for",
"the",
"given",
"number",
"value",
".",
"The",
"number",
"should",
"be",
"passed",
"as",
"a",
"string",
"with",
"dot",
"as",
"decimal",
"separato... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L1576-L1595 | train | Returns the plural test for the given number | [
30522,
3853,
1006,
1055,
19172,
5677,
1007,
1063,
13075,
6728,
7630,
7941,
2015,
1027,
2023,
1012,
1035,
2131,
1006,
1000,
13994,
2015,
1000,
1007,
1025,
2065,
1006,
2828,
11253,
1055,
19172,
5677,
1027,
1027,
1027,
1000,
2193,
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... | |
apache/incubator-echarts | src/util/clazz.js | superCall | function superCall(context, methodName) {
var args = zrUtil.slice(arguments, 2);
return this.superClass.prototype[methodName].apply(context, args);
} | javascript | function superCall(context, methodName) {
var args = zrUtil.slice(arguments, 2);
return this.superClass.prototype[methodName].apply(context, args);
} | [
"function",
"superCall",
"(",
"context",
",",
"methodName",
")",
"{",
"var",
"args",
"=",
"zrUtil",
".",
"slice",
"(",
"arguments",
",",
"2",
")",
";",
"return",
"this",
".",
"superClass",
".",
"prototype",
"[",
"methodName",
"]",
".",
"apply",
"(",
"c... | superCall should have class info, which can not be fetch from 'this'. Consider this case: class A has method f, class B inherits class A, overrides method f, f call superApply('f'), class C inherits class B, do not overrides method f, then when method of class C is called, dead loop occured. | [
"superCall",
"should",
"have",
"class",
"info",
"which",
"can",
"not",
"be",
"fetch",
"from",
"this",
".",
"Consider",
"this",
"case",
":",
"class",
"A",
"has",
"method",
"f",
"class",
"B",
"inherits",
"class",
"A",
"overrides",
"method",
"f",
"f",
"call... | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/util/clazz.js#L117-L120 | train | This method is called by the super class to call the method with the arguments passed to the method. | [
30522,
3853,
3565,
9289,
2140,
1006,
6123,
1010,
4118,
18442,
1007,
1063,
13075,
12098,
5620,
1027,
1062,
22134,
4014,
1012,
14704,
1006,
9918,
1010,
1016,
1007,
1025,
2709,
2023,
1012,
3565,
26266,
1012,
8773,
1031,
4118,
18442,
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... |
aws/aws-sdk-js | lib/config.js | setPromisesDependency | function setPromisesDependency(dep) {
PromisesDependency = dep;
// if null was passed in, we should try to use native promises
if (dep === null && typeof Promise === 'function') {
PromisesDependency = Promise;
}
var constructors = [AWS.Request, AWS.Credentials, AWS.CredentialProviderChain];
... | javascript | function setPromisesDependency(dep) {
PromisesDependency = dep;
// if null was passed in, we should try to use native promises
if (dep === null && typeof Promise === 'function') {
PromisesDependency = Promise;
}
var constructors = [AWS.Request, AWS.Credentials, AWS.CredentialProviderChain];
... | [
"function",
"setPromisesDependency",
"(",
"dep",
")",
"{",
"PromisesDependency",
"=",
"dep",
";",
"// if null was passed in, we should try to use native promises",
"if",
"(",
"dep",
"===",
"null",
"&&",
"typeof",
"Promise",
"===",
"'function'",
")",
"{",
"PromisesDepend... | Sets the promise dependency the SDK will use wherever Promises are returned.
Passing `null` will force the SDK to use native Promises if they are available.
If native Promises are not available, passing `null` will have no effect.
@param [Constructor] dep A reference to a Promise constructor | [
"Sets",
"the",
"promise",
"dependency",
"the",
"SDK",
"will",
"use",
"wherever",
"Promises",
"are",
"returned",
".",
"Passing",
"null",
"will",
"force",
"the",
"SDK",
"to",
"use",
"native",
"Promises",
"if",
"they",
"are",
"available",
".",
"If",
"native",
... | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/config.js#L550-L559 | train | set the promise dependency | [
30522,
3853,
2275,
21572,
28732,
16150,
13699,
10497,
11916,
1006,
2139,
2361,
1007,
1063,
10659,
3207,
11837,
4181,
5666,
1027,
2139,
2361,
1025,
1013,
1013,
2065,
19701,
2001,
2979,
1999,
1010,
2057,
2323,
3046,
2000,
2224,
3128,
10659,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/type/Decimal.js | setConstraints | function setConstraints(oType, oConstraints) {
var vNullable, iPrecision, vPrecision, iScale, vScale;
function logWarning(vValue, sName) {
Log.warning("Illegal " + sName + ": " + vValue, null, oType.getName());
}
function validateInt(vValue, iDefault, iMinimum, sName) {
var iValue = typeof vValue === "s... | javascript | function setConstraints(oType, oConstraints) {
var vNullable, iPrecision, vPrecision, iScale, vScale;
function logWarning(vValue, sName) {
Log.warning("Illegal " + sName + ": " + vValue, null, oType.getName());
}
function validateInt(vValue, iDefault, iMinimum, sName) {
var iValue = typeof vValue === "s... | [
"function",
"setConstraints",
"(",
"oType",
",",
"oConstraints",
")",
"{",
"var",
"vNullable",
",",
"iPrecision",
",",
"vPrecision",
",",
"iScale",
",",
"vScale",
";",
"function",
"logWarning",
"(",
"vValue",
",",
"sName",
")",
"{",
"Log",
".",
"warning",
... | Sets the constraints.
@param {sap.ui.model.odata.type.Decimal} oType
the type instance
@param {object} [oConstraints]
constraints, see {@link #constructor} | [
"Sets",
"the",
"constraints",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/type/Decimal.js#L80-L164 | train | Sets constraints for the given Edm. Type | [
30522,
3853,
2275,
8663,
20528,
18447,
2015,
1006,
27178,
18863,
1010,
1051,
8663,
20528,
18447,
2015,
1007,
1063,
13075,
1058,
11231,
4571,
3468,
1010,
12997,
2890,
28472,
1010,
21210,
2890,
28472,
1010,
2003,
9289,
2063,
1010,
5443,
9289,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Package.js | installFromURL | function installFromURL(url) {
var STATE_DOWNLOADING = 1,
STATE_INSTALLING = 2,
STATE_SUCCEEDED = 3,
STATE_FAILED = 4;
var d = new $.Deferred();
var state = STATE_DOWNLOADING;
var downloadId = (_uniqueId++);
download(url, downloadId)
... | javascript | function installFromURL(url) {
var STATE_DOWNLOADING = 1,
STATE_INSTALLING = 2,
STATE_SUCCEEDED = 3,
STATE_FAILED = 4;
var d = new $.Deferred();
var state = STATE_DOWNLOADING;
var downloadId = (_uniqueId++);
download(url, downloadId)
... | [
"function",
"installFromURL",
"(",
"url",
")",
"{",
"var",
"STATE_DOWNLOADING",
"=",
"1",
",",
"STATE_INSTALLING",
"=",
"2",
",",
"STATE_SUCCEEDED",
"=",
"3",
",",
"STATE_FAILED",
"=",
"4",
";",
"var",
"d",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
"... | On success, resolves with an extension metadata object; at that point, the extension has already
started running in Brackets. On failure (including validation errors), rejects with an error object.
An error object consists of either a string error code OR an array where the first entry is the error
code and the remain... | [
"On",
"success",
"resolves",
"with",
"an",
"extension",
"metadata",
"object",
";",
"at",
"that",
"point",
"the",
"extension",
"has",
"already",
"started",
"running",
"in",
"Brackets",
".",
"On",
"failure",
"(",
"including",
"validation",
"errors",
")",
"reject... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/Package.js#L352-L405 | train | Installs a file from a URL | [
30522,
3853,
16500,
19699,
5358,
3126,
2140,
1006,
24471,
2140,
1007,
1063,
13075,
2110,
1035,
8816,
2075,
1027,
1015,
1010,
2110,
1035,
23658,
1027,
1016,
1010,
2110,
1035,
4594,
1027,
1017,
1010,
2110,
1035,
3478,
1027,
1018,
1025,
13075,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | onConfirmPasswordReset | function onConfirmPasswordReset() {
var code = $('#password-reset-code').val();
var password = $('#password-reset-password').val();
auth.confirmPasswordReset(code, password).then(function() {
alertSuccess('Password has been changed!');
}, onAuthError);
} | javascript | function onConfirmPasswordReset() {
var code = $('#password-reset-code').val();
var password = $('#password-reset-password').val();
auth.confirmPasswordReset(code, password).then(function() {
alertSuccess('Password has been changed!');
}, onAuthError);
} | [
"function",
"onConfirmPasswordReset",
"(",
")",
"{",
"var",
"code",
"=",
"$",
"(",
"'#password-reset-code'",
")",
".",
"val",
"(",
")",
";",
"var",
"password",
"=",
"$",
"(",
"'#password-reset-password'",
")",
".",
"val",
"(",
")",
";",
"auth",
".",
"con... | Confirms the password reset with the code and password supplied by the user. | [
"Confirms",
"the",
"password",
"reset",
"with",
"the",
"code",
"and",
"password",
"supplied",
"by",
"the",
"user",
"."
] | 491598a499813dacc23724de5e237ec220cc560e | https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/auth/demo/public/script.js#L709-L715 | train | Confirm password reset | [
30522,
3853,
2006,
8663,
27972,
15194,
18351,
6072,
3388,
1006,
1007,
1063,
13075,
3642,
1027,
1002,
1006,
1005,
1001,
20786,
1011,
25141,
1011,
3642,
1005,
1007,
1012,
11748,
1006,
1007,
1025,
13075,
20786,
1027,
1002,
1006,
1005,
1001,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableUtils.js | function(oTable) {
var iFixedBottomRowCount = oTable.getFixedBottomRowCount();
var oBinding = oTable.getBinding("rows");
var iFirstFixedBottomIndex = -1;
if (oBinding && iFixedBottomRowCount > 0) {
var iVisibleRowCount = oTable.getVisibleRowCount();
var iFirstVisibleRow = oTable.getFirstVisibleRow(... | javascript | function(oTable) {
var iFixedBottomRowCount = oTable.getFixedBottomRowCount();
var oBinding = oTable.getBinding("rows");
var iFirstFixedBottomIndex = -1;
if (oBinding && iFixedBottomRowCount > 0) {
var iVisibleRowCount = oTable.getVisibleRowCount();
var iFirstVisibleRow = oTable.getFirstVisibleRow(... | [
"function",
"(",
"oTable",
")",
"{",
"var",
"iFixedBottomRowCount",
"=",
"oTable",
".",
"getFixedBottomRowCount",
"(",
")",
";",
"var",
"oBinding",
"=",
"oTable",
".",
"getBinding",
"(",
"\"rows\"",
")",
";",
"var",
"iFirstFixedBottomIndex",
"=",
"-",
"1",
"... | Returns the index of the first fixed bottom row in the <code>rows</code> aggregation.
@param {sap.ui.table.Table} oTable Instance of the table.
@returns {int} The index of the first fixed bottom row in the <code>rows</code> aggregation, or <code>-1</code>. | [
"Returns",
"the",
"index",
"of",
"the",
"first",
"fixed",
"bottom",
"row",
"in",
"the",
"<code",
">",
"rows<",
"/",
"code",
">",
"aggregation",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableUtils.js#L1119-L1140 | train | Returns the index of the bottom row of the table. | [
30522,
3853,
1006,
27178,
3085,
1007,
1063,
13075,
2065,
7646,
2098,
18384,
20389,
10524,
3597,
16671,
1027,
27178,
3085,
1012,
2131,
23901,
18384,
20389,
10524,
3597,
16671,
1006,
1007,
1025,
13075,
27885,
22254,
2075,
1027,
30524,
20389,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
dcloudio/mui | examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js | function (q, a, b, x, s, t) {
return safe_add(bit_rol(safe_add(safe_add(a, q),safe_add(x, t)), s),b);
} | javascript | function (q, a, b, x, s, t) {
return safe_add(bit_rol(safe_add(safe_add(a, q),safe_add(x, t)), s),b);
} | [
"function",
"(",
"q",
",",
"a",
",",
"b",
",",
"x",
",",
"s",
",",
"t",
")",
"{",
"return",
"safe_add",
"(",
"bit_rol",
"(",
"safe_add",
"(",
"safe_add",
"(",
"a",
",",
"q",
")",
",",
"safe_add",
"(",
"x",
",",
"t",
")",
")",
",",
"s",
")",... | /*
These functions implement the four basic operations the algorithm uses. | [
"/",
"*",
"These",
"functions",
"implement",
"the",
"four",
"basic",
"operations",
"the",
"algorithm",
"uses",
"."
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L342-L344 | train | A function that adds two terms of the terms | [
30522,
3853,
1006,
1053,
1010,
1037,
1010,
1038,
1010,
1060,
1010,
1055,
1010,
1056,
1007,
1063,
2709,
3647,
1035,
5587,
1006,
2978,
1035,
20996,
2140,
1006,
3647,
1035,
5587,
1006,
3647,
1035,
5587,
1006,
1037,
1010,
1053,
1007,
1010,
36... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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() {
var aSorterObjects = [];
for (var i = -1, oCondition; (oCondition = this._aSortCondition[++i]) !== undefined;) {
aSorterObjects.push(new Sorter(oCondition.property.name,
oCondition.order == odata4analytics.SortOrder.Descending));
}
return aSorterObjects;
} | javascript | function() {
var aSorterObjects = [];
for (var i = -1, oCondition; (oCondition = this._aSortCondition[++i]) !== undefined;) {
aSorterObjects.push(new Sorter(oCondition.property.name,
oCondition.order == odata4analytics.SortOrder.Descending));
}
return aSorterObjects;
} | [
"function",
"(",
")",
"{",
"var",
"aSorterObjects",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"-",
"1",
",",
"oCondition",
";",
"(",
"oCondition",
"=",
"this",
".",
"_aSortCondition",
"[",
"++",
"i",
"]",
")",
"!==",
"undefined",
";",
")",
... | Get an array of SAPUI5 Sorter objects corresponding to this expression.
@returns {sap.ui.model.Sorter[]} List of sorter objects representing
this expression
@public
@function
@name sap.ui.model.analytics.odata4analytics.SortExpression#getExpressionsAsUI5SorterArray | [
"Get",
"an",
"array",
"of",
"SAPUI5",
"Sorter",
"objects",
"corresponding",
"to",
"this",
"expression",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L3742-L3751 | train | Returns an array of Sorter objects that can be used to sort the data by the order of the data. | [
30522,
3853,
1006,
1007,
1063,
13075,
2004,
11589,
10624,
2497,
20614,
2015,
1027,
1031,
1033,
1025,
2005,
1006,
13075,
1045,
1027,
1011,
1015,
1010,
1051,
8663,
20562,
1025,
1006,
1051,
8663,
20562,
1027,
2023,
1012,
1035,
2004,
11589,
866... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
GeekyAnts/vue-native-core | packages/vue-server-renderer/build.js | optimize | function optimize (root, options) {
if (!root) { return }
isStaticKey = genStaticKeysCached(options.staticKeys || '');
isPlatformReservedTag = options.isReservedTag || no;
// first pass: mark all non-static nodes.
markStatic(root);
// second pass: mark static roots.
markStaticRoots(root, false);
} | javascript | function optimize (root, options) {
if (!root) { return }
isStaticKey = genStaticKeysCached(options.staticKeys || '');
isPlatformReservedTag = options.isReservedTag || no;
// first pass: mark all non-static nodes.
markStatic(root);
// second pass: mark static roots.
markStaticRoots(root, false);
} | [
"function",
"optimize",
"(",
"root",
",",
"options",
")",
"{",
"if",
"(",
"!",
"root",
")",
"{",
"return",
"}",
"isStaticKey",
"=",
"genStaticKeysCached",
"(",
"options",
".",
"staticKeys",
"||",
"''",
")",
";",
"isPlatformReservedTag",
"=",
"options",
"."... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ski... | [
"Goal",
"of",
"the",
"optimizer",
":",
"walk",
"the",
"generated",
"template",
"AST",
"tree",
"and",
"detect",
"sub",
"-",
"trees",
"that",
"are",
"purely",
"static",
"i",
".",
"e",
".",
"parts",
"of",
"the",
"DOM",
"that",
"never",
"needs",
"to",
"cha... | a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e | https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/packages/vue-server-renderer/build.js#L3484-L3492 | train | optimize a node | [
30522,
3853,
23569,
27605,
4371,
1006,
7117,
1010,
7047,
1007,
1063,
2065,
1006,
999,
7117,
1007,
1063,
2709,
1065,
26354,
29336,
6799,
3240,
1027,
8991,
16677,
14839,
15782,
7690,
1006,
7047,
30524,
4017,
14192,
6072,
25944,
15900,
1027,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/dom-utils.js | unwrapNode | function unwrapNode(aNode) {
var node = aNode;
if (node) {
// unwrap is not available on older branches (3.5 and 3.6) - Bug 533596
if ("unwrap" in XPCNativeWrapper) {
node = XPCNativeWrapper.unwrap(node);
}
else if ("wrappedJSObject" in node) {
node = node.wrappedJSObject;
}
}
... | javascript | function unwrapNode(aNode) {
var node = aNode;
if (node) {
// unwrap is not available on older branches (3.5 and 3.6) - Bug 533596
if ("unwrap" in XPCNativeWrapper) {
node = XPCNativeWrapper.unwrap(node);
}
else if ("wrappedJSObject" in node) {
node = node.wrappedJSObject;
}
}
... | [
"function",
"unwrapNode",
"(",
"aNode",
")",
"{",
"var",
"node",
"=",
"aNode",
";",
"if",
"(",
"node",
")",
"{",
"// unwrap is not available on older branches (3.5 and 3.6) - Bug 533596",
"if",
"(",
"\"unwrap\"",
"in",
"XPCNativeWrapper",
")",
"{",
"node",
"=",
"X... | Unwraps a node which is wrapped into a XPCNativeWrapper or XrayWrapper
@param {DOMnode} Wrapped DOM node
@returns {DOMNode} Unwrapped DOM node | [
"Unwraps",
"a",
"node",
"which",
"is",
"wrapped",
"into",
"a",
"XPCNativeWrapper",
"or",
"XrayWrapper"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/dom-utils.js#L49-L63 | train | Unwraps a node | [
30522,
3853,
4895,
13088,
9331,
3630,
3207,
1006,
2019,
10244,
1007,
1063,
13075,
13045,
1027,
2019,
10244,
1025,
2065,
1006,
13045,
1007,
1063,
1013,
1013,
4895,
13088,
9331,
2003,
2025,
2800,
2006,
3080,
5628,
1006,
1017,
1012,
1019,
1998... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
goldfire/howler.js | dist/howler.js | function(event) {
var self = this;
if (self._queue.length > 0) {
var task = self._queue[0];
// Remove this task if a matching event was passed.
if (task.event === event) {
self._queue.shift();
self._loadQueue();
}
// Run the task if no event typ... | javascript | function(event) {
var self = this;
if (self._queue.length > 0) {
var task = self._queue[0];
// Remove this task if a matching event was passed.
if (task.event === event) {
self._queue.shift();
self._loadQueue();
}
// Run the task if no event typ... | [
"function",
"(",
"event",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"self",
".",
"_queue",
".",
"length",
">",
"0",
")",
"{",
"var",
"task",
"=",
"self",
".",
"_queue",
"[",
"0",
"]",
";",
"// Remove this task if a matching event was passed."... | Queue of actions initiated before the sound has loaded.
These will be called in sequence, with the next only firing
after the previous has finished executing (even if async like play).
@return {Howl} | [
"Queue",
"of",
"actions",
"initiated",
"before",
"the",
"sound",
"has",
"loaded",
".",
"These",
"will",
"be",
"called",
"in",
"sequence",
"with",
"the",
"next",
"only",
"firing",
"after",
"the",
"previous",
"has",
"finished",
"executing",
"(",
"even",
"if",
... | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L1879-L1898 | train | Run the next task in the queue | [
30522,
3853,
1006,
2724,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
2065,
1006,
2969,
1012,
1035,
24240,
1012,
3091,
1028,
1014,
1007,
1063,
13075,
4708,
1027,
2969,
1012,
1035,
24240,
1031,
1014,
1033,
1025,
1013,
1013,
6366,
2023,
4708,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/library.js | checkAndSetProperty | function checkAndSetProperty(oControl, property, value) {
if (value !== undefined) {
var fSetter = oControl['set' + capitalize(property)];
if (typeof (fSetter) === "function") {
fSetter.call(oControl, value);
return true;
}
}
return false;
} | javascript | function checkAndSetProperty(oControl, property, value) {
if (value !== undefined) {
var fSetter = oControl['set' + capitalize(property)];
if (typeof (fSetter) === "function") {
fSetter.call(oControl, value);
return true;
}
}
return false;
} | [
"function",
"checkAndSetProperty",
"(",
"oControl",
",",
"property",
",",
"value",
")",
"{",
"if",
"(",
"value",
"!==",
"undefined",
")",
"{",
"var",
"fSetter",
"=",
"oControl",
"[",
"'set'",
"+",
"capitalize",
"(",
"property",
")",
"]",
";",
"if",
"(",
... | Checks if value is not undefined, in which case the
setter function for a given property is called.
Returns true if value is set, false otherwise.
@private | [
"Checks",
"if",
"value",
"is",
"not",
"undefined",
"in",
"which",
"case",
"the",
"setter",
"function",
"for",
"a",
"given",
"property",
"is",
"called",
".",
"Returns",
"true",
"if",
"value",
"is",
"set",
"false",
"otherwise",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/library.js#L4289-L4298 | train | Sets the value of a property on the control | [
30522,
3853,
4638,
29560,
3388,
21572,
4842,
3723,
1006,
1051,
8663,
13181,
2140,
1010,
3200,
1010,
3643,
1007,
1063,
2065,
1006,
3643,
999,
1027,
1027,
6151,
28344,
1007,
1063,
13075,
1042,
21678,
2121,
1027,
1051,
8663,
13181,
2140,
1031,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aframevr/aframe | src/shaders/flat.js | getMaterialData | function getMaterialData (data, materialData) {
materialData.color.set(data.color);
materialData.fog = data.fog;
materialData.wireframe = data.wireframe;
materialData.wireframeLinewidth = data.wireframeLinewidth;
return materialData;
} | javascript | function getMaterialData (data, materialData) {
materialData.color.set(data.color);
materialData.fog = data.fog;
materialData.wireframe = data.wireframe;
materialData.wireframeLinewidth = data.wireframeLinewidth;
return materialData;
} | [
"function",
"getMaterialData",
"(",
"data",
",",
"materialData",
")",
"{",
"materialData",
".",
"color",
".",
"set",
"(",
"data",
".",
"color",
")",
";",
"materialData",
".",
"fog",
"=",
"data",
".",
"fog",
";",
"materialData",
".",
"wireframe",
"=",
"da... | Builds and normalize material data, normalizing stuff along the way.
@param {object} data - Material data.
@param {object} materialData - Object to reuse.
@returns {object} Updated material data. | [
"Builds",
"and",
"normalize",
"material",
"data",
"normalizing",
"stuff",
"along",
"the",
"way",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/shaders/flat.js#L62-L68 | train | Get material data | [
30522,
3853,
2131,
8585,
14482,
2850,
2696,
1006,
2951,
1010,
3430,
2850,
2696,
1007,
1063,
3430,
2850,
2696,
1012,
3609,
1012,
2275,
1006,
2951,
1012,
3609,
1007,
1025,
3430,
2850,
2696,
1012,
9666,
1027,
2951,
1012,
9666,
1025,
3430,
28... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/LiveDevelopment/MultiBrowserImpl/protocol/LiveDevProtocol.js | _send | function _send(msg, clients) {
var id = _nextMsgId++,
result = new $.Deferred();
// broadcast if there are no specific clients
clients = clients || getConnectionIds();
msg.id = id;
_responseDeferreds[id] = result;
_transport.send(clients, JSON.stringify(msg))... | javascript | function _send(msg, clients) {
var id = _nextMsgId++,
result = new $.Deferred();
// broadcast if there are no specific clients
clients = clients || getConnectionIds();
msg.id = id;
_responseDeferreds[id] = result;
_transport.send(clients, JSON.stringify(msg))... | [
"function",
"_send",
"(",
"msg",
",",
"clients",
")",
"{",
"var",
"id",
"=",
"_nextMsgId",
"++",
",",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"// broadcast if there are no specific clients",
"clients",
"=",
"clients",
"||",
"getConnectionIds... | @private
Dispatches a message to the remote protocol handler via the transport.
@param {Object} msg The message to send.
@param {number|Array.<number>} idOrArray ID or IDs of the client(s) that should
receive the message.
@return {$.Promise} A promise that's fulfilled when the response to the message is received. | [
"@private",
"Dispatches",
"a",
"message",
"to",
"the",
"remote",
"protocol",
"handler",
"via",
"the",
"transport",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/protocol/LiveDevProtocol.js#L137-L147 | train | send a message to a set of clients | [
30522,
3853,
1035,
4604,
1006,
5796,
2290,
1010,
7846,
1007,
1063,
13075,
8909,
1027,
1035,
2279,
5244,
5856,
2094,
1009,
1009,
1010,
2765,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1025,
1013,
1013,
3743,
2065,
2045,
2024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
PrismJS/prism | scripts/utopia.js | function(objects) {
var ret = {};
for(var i=0; i<arguments.length; i++) {
var o = arguments[i];
for(var j in o) {
ret[j] = o[j];
}
}
return ret;
} | javascript | function(objects) {
var ret = {};
for(var i=0; i<arguments.length; i++) {
var o = arguments[i];
for(var j in o) {
ret[j] = o[j];
}
}
return ret;
} | [
"function",
"(",
"objects",
")",
"{",
"var",
"ret",
"=",
"{",
"}",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"arguments",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"o",
"=",
"arguments",
"[",
"i",
"]",
";",
"for",
"(",
"va... | Copies the properties of one object onto another.
When there is a collision, the later one wins
@return {Object} destination object | [
"Copies",
"the",
"properties",
"of",
"one",
"object",
"onto",
"another",
".",
"When",
"there",
"is",
"a",
"collision",
"the",
"later",
"one",
"wins"
] | acceb3b56f0e8362a7ef274dbd85b17611df2ec4 | https://github.com/PrismJS/prism/blob/acceb3b56f0e8362a7ef274dbd85b17611df2ec4/scripts/utopia.js#L112-L124 | train | Returns an object containing the properties of the specified objects. | [
30522,
3853,
1006,
5200,
1007,
1063,
13075,
2128,
2102,
1027,
1063,
1065,
1025,
2005,
1006,
13075,
1045,
30524,
1031,
1045,
1033,
1025,
2005,
1006,
13075,
1046,
1999,
1051,
1007,
1063,
2128,
2102,
1031,
1046,
1033,
1027,
1051,
1031,
1046,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
exceljs/exceljs | lib/doc/worksheet.js | addImageToCells | function addImageToCells(imageId, range) {
const model = {
type: 'image',
imageId,
range,
};
this._media.push(new Image(this, model));
} | javascript | function addImageToCells(imageId, range) {
const model = {
type: 'image',
imageId,
range,
};
this._media.push(new Image(this, model));
} | [
"function",
"addImageToCells",
"(",
"imageId",
",",
"range",
")",
"{",
"const",
"model",
"=",
"{",
"type",
":",
"'image'",
",",
"imageId",
",",
"range",
",",
"}",
";",
"this",
".",
"_media",
".",
"push",
"(",
"new",
"Image",
"(",
"this",
",",
"model"... | ========================================================================= Images | [
"=========================================================================",
"Images"
] | c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2 | https://github.com/exceljs/exceljs/blob/c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2/lib/doc/worksheet.js#L537-L544 | train | Add an image to the cells | [
30522,
3853,
5587,
9581,
18150,
10085,
5349,
2015,
1006,
3746,
3593,
1010,
2846,
1007,
1063,
9530,
3367,
2944,
1027,
1063,
2828,
1024,
1005,
3746,
1005,
1010,
3746,
3593,
1010,
2846,
1010,
1065,
1025,
2023,
1012,
1035,
2865,
1012,
5245,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/dom/jquery/parentByAttribute.js | parentByAttribute | function parentByAttribute(sAttribute, sValue) {
if (this.length > 0) {
if (sValue) {
return this.first().parents("[" + sAttribute + "='" + sValue + "']").get(0);
} else {
return this.first().parents("[" + sAttribute + "]").get(0);
}
}
} | javascript | function parentByAttribute(sAttribute, sValue) {
if (this.length > 0) {
if (sValue) {
return this.first().parents("[" + sAttribute + "='" + sValue + "']").get(0);
} else {
return this.first().parents("[" + sAttribute + "]").get(0);
}
}
} | [
"function",
"parentByAttribute",
"(",
"sAttribute",
",",
"sValue",
")",
"{",
"if",
"(",
"this",
".",
"length",
">",
"0",
")",
"{",
"if",
"(",
"sValue",
")",
"{",
"return",
"this",
".",
"first",
"(",
")",
".",
"parents",
"(",
"\"[\"",
"+",
"sAttribute... | This module provides the {@link jQuery#parentByAttribute} API.
@namespace
@name module:sap/ui/dom/jquery/parentByAttribute
@public
@since 1.58
Gets the next parent DOM element with a given attribute and attribute value starting above the first given element
@param {string} sAttribute Name of the attribute
@param {s... | [
"This",
"module",
"provides",
"the",
"{",
"@link",
"jQuery#parentByAttribute",
"}",
"API",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/dom/jquery/parentByAttribute.js#L29-L37 | train | Returns the parent of the first node with the given attribute and value | [
30522,
3853,
6687,
3762,
19321,
3089,
8569,
2618,
1006,
2938,
18886,
8569,
30524,
1014,
1007,
1063,
2065,
1006,
17917,
2389,
5657,
1007,
1063,
2709,
2023,
1012,
2034,
1006,
1007,
1012,
3008,
1006,
1000,
1031,
1000,
1009,
2938,
18886,
8569,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
facebook/watchman | node/index.js | vers_compare | function vers_compare(a, b) {
a = a.split('.');
b = b.split('.');
for (var i = 0; i < 3; i++) {
var d = parseInt(a[i] || '0') - parseInt(b[i] || '0');
if (d != 0) {
return d;
}
}
return 0; // Equal
} | javascript | function vers_compare(a, b) {
a = a.split('.');
b = b.split('.');
for (var i = 0; i < 3; i++) {
var d = parseInt(a[i] || '0') - parseInt(b[i] || '0');
if (d != 0) {
return d;
}
}
return 0; // Equal
} | [
"function",
"vers_compare",
"(",
"a",
",",
"b",
")",
"{",
"a",
"=",
"a",
".",
"split",
"(",
"'.'",
")",
";",
"b",
"=",
"b",
".",
"split",
"(",
"'.'",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"3",
";",
"i",
"++",
")",
"... | Compares a vs b, returns < 0 if a < b, > 0 if b > b, 0 if a == b | [
"Compares",
"a",
"vs",
"b",
"returns",
"<",
"0",
"if",
"a",
"<",
"b",
">",
"0",
"if",
"b",
">",
"b",
"0",
"if",
"a",
"==",
"b"
] | 8d576a2d3e1191c977f03f584993da63a3b8e5ec | https://github.com/facebook/watchman/blob/8d576a2d3e1191c977f03f584993da63a3b8e5ec/node/index.js#L249-L259 | train | Compare two vers_list | [
30522,
3853,
2310,
2869,
1035,
12826,
1006,
1037,
1010,
1038,
1007,
1063,
1037,
1027,
1037,
1012,
3975,
1006,
1005,
1012,
1005,
1007,
1025,
1038,
1027,
1038,
1012,
3975,
1006,
1005,
1012,
1005,
1007,
1025,
2005,
1006,
13075,
1045,
1027,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
openlayers/openlayers | examples/mapbox-vector-tiles-advanced.js | tileUrlFunction | function tileUrlFunction(tileCoord) {
return ('https://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' +
'{z}/{x}/{y}.vector.pbf?access_token=' + key)
.replace('{z}', String(tileCoord[0] * 2 - 1))
.replace('{x}', String(tileCoord[1]))
.replace('{y}', String(tileCoord[2]))
.replace('{a-d}', ... | javascript | function tileUrlFunction(tileCoord) {
return ('https://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/' +
'{z}/{x}/{y}.vector.pbf?access_token=' + key)
.replace('{z}', String(tileCoord[0] * 2 - 1))
.replace('{x}', String(tileCoord[1]))
.replace('{y}', String(tileCoord[2]))
.replace('{a-d}', ... | [
"function",
"tileUrlFunction",
"(",
"tileCoord",
")",
"{",
"return",
"(",
"'https://{a-d}.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/'",
"+",
"'{z}/{x}/{y}.vector.pbf?access_token='",
"+",
"key",
")",
".",
"replace",
"(",
"'{z}'",
",",
"String",
"(",
"tileCoord",
"[",
... | Calculation of tile urls for zoom levels 1, 3, 5, 7, 9, 11, 13, 15. | [
"Calculation",
"of",
"tile",
"urls",
"for",
"zoom",
"levels",
"1",
"3",
"5",
"7",
"9",
"11",
"13",
"15",
"."
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/examples/mapbox-vector-tiles-advanced.js#L19-L27 | train | Returns a url function for a tile | [
30522,
3853,
14090,
3126,
10270,
4609,
7542,
1006,
14090,
3597,
8551,
1007,
1063,
2709,
1006,
1005,
16770,
1024,
1013,
1013,
1063,
1037,
1011,
1040,
1065,
1012,
13262,
1012,
4949,
8758,
1012,
4012,
1013,
1058,
2549,
1013,
4949,
8758,
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... |
apache/incubator-echarts | src/chart/themeRiver/themeRiverLayout.js | computeBaseline | function computeBaseline(data) {
var layerNum = data.length;
var pointNum = data[0].length;
var sums = [];
var y0 = [];
var max = 0;
var temp;
var base = {};
for (var i = 0; i < pointNum; ++i) {
for (var j = 0, temp = 0; j < layerNum; ++j) {
temp += data[j][i][1];
... | javascript | function computeBaseline(data) {
var layerNum = data.length;
var pointNum = data[0].length;
var sums = [];
var y0 = [];
var max = 0;
var temp;
var base = {};
for (var i = 0; i < pointNum; ++i) {
for (var j = 0, temp = 0; j < layerNum; ++j) {
temp += data[j][i][1];
... | [
"function",
"computeBaseline",
"(",
"data",
")",
"{",
"var",
"layerNum",
"=",
"data",
".",
"length",
";",
"var",
"pointNum",
"=",
"data",
"[",
"0",
"]",
".",
"length",
";",
"var",
"sums",
"=",
"[",
"]",
";",
"var",
"y0",
"=",
"[",
"]",
";",
"var"... | Compute the baseLine of the rawdata
Inspired by Lee Byron's paper Stacked Graphs - Geometry & Aesthetics
@param {Array.<Array>} data the points in each layer
@return {Object} | [
"Compute",
"the",
"baseLine",
"of",
"the",
"rawdata",
"Inspired",
"by",
"Lee",
"Byron",
"s",
"paper",
"Stacked",
"Graphs",
"-",
"Geometry",
"&",
"Aesthetics"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/themeRiver/themeRiverLayout.js#L127-L161 | train | Computes the baseline of the given data | [
30522,
3853,
24134,
15058,
4179,
1006,
2951,
1007,
1063,
13075,
6741,
19172,
1027,
2951,
1012,
3091,
1025,
13075,
2391,
19172,
1027,
2951,
1031,
1014,
1033,
1012,
3091,
1025,
13075,
20571,
1027,
1031,
1033,
1025,
13075,
1061,
2692,
1027,
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.fl/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js | function (sQuery) {
// add filter for search
var aFilters = [];
if (sQuery && sQuery.length > 0) {
aFilters = new Filter({
filters: [
new Filter("name", FilterOperator.Contains, sQuery),
new Filter("fileType", FilterOperator.Contains, sQuery)
],
and: false
});
}
// upd... | javascript | function (sQuery) {
// add filter for search
var aFilters = [];
if (sQuery && sQuery.length > 0) {
aFilters = new Filter({
filters: [
new Filter("name", FilterOperator.Contains, sQuery),
new Filter("fileType", FilterOperator.Contains, sQuery)
],
and: false
});
}
// upd... | [
"function",
"(",
"sQuery",
")",
"{",
"// add filter for search",
"var",
"aFilters",
"=",
"[",
"]",
";",
"if",
"(",
"sQuery",
"&&",
"sQuery",
".",
"length",
">",
"0",
")",
"{",
"aFilters",
"=",
"new",
"Filter",
"(",
"{",
"filters",
":",
"[",
"new",
"F... | Filters the binding of the master list;
This function is also called once navigation to the page to clear the filters or input search entry.
@param {String} sQuery - entered string within the search field
@public | [
"Filters",
"the",
"binding",
"of",
"the",
"master",
"list",
";",
"This",
"function",
"is",
"also",
"called",
"once",
"navigation",
"to",
"the",
"page",
"to",
"clear",
"the",
"filters",
"or",
"input",
"search",
"entry",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js#L96-L113 | train | search for all items in the master components list | [
30522,
3853,
1006,
5490,
13094,
2100,
1007,
1063,
1013,
1013,
5587,
11307,
2005,
3945,
13075,
28697,
21928,
2015,
1027,
1031,
1033,
1025,
2065,
1006,
5490,
13094,
2100,
1004,
1004,
5490,
13094,
2100,
1012,
3091,
1028,
1014,
1007,
1063,
2869... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/menu/js/menuServiceProvider.js | detachElement | function detachElement(element, opts) {
if (!opts.preserveElement) {
if (toNode(element).parentNode === toNode(opts.parent)) {
toNode(opts.parent).removeChild(toNode(element));
}
} else {
toNode(element).style.display = 'none';
}
} | javascript | function detachElement(element, opts) {
if (!opts.preserveElement) {
if (toNode(element).parentNode === toNode(opts.parent)) {
toNode(opts.parent).removeChild(toNode(element));
}
} else {
toNode(element).style.display = 'none';
}
} | [
"function",
"detachElement",
"(",
"element",
",",
"opts",
")",
"{",
"if",
"(",
"!",
"opts",
".",
"preserveElement",
")",
"{",
"if",
"(",
"toNode",
"(",
"element",
")",
".",
"parentNode",
"===",
"toNode",
"(",
"opts",
".",
"parent",
")",
")",
"{",
"to... | Use browser to remove this element without triggering a $destroy event | [
"Use",
"browser",
"to",
"remove",
"this",
"element",
"without",
"triggering",
"a",
"$destroy",
"event"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/menu/js/menuServiceProvider.js#L427-L435 | train | Detach an element from the page | [
30522,
3853,
20010,
15395,
16930,
4765,
1006,
5783,
1010,
23569,
2015,
1007,
1063,
2065,
1006,
999,
23569,
2015,
1012,
7969,
12260,
30524,
10228,
10244,
1006,
5783,
1007,
1012,
6687,
3630,
3207,
1027,
1027,
1027,
10228,
10244,
1006,
23569,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
serverless/serverless | lib/utils/config/index.js | set | function set(key, value) {
let config = getGlobalConfig();
if (key && typeof key === 'string' && typeof value !== 'undefined') {
config = _.set(config, key, value);
} else if (_.isObject(key)) {
config = _.merge(config, key);
} else if (typeof value !== 'undefined') {
config = _.merge(config, value)... | javascript | function set(key, value) {
let config = getGlobalConfig();
if (key && typeof key === 'string' && typeof value !== 'undefined') {
config = _.set(config, key, value);
} else if (_.isObject(key)) {
config = _.merge(config, key);
} else if (typeof value !== 'undefined') {
config = _.merge(config, value)... | [
"function",
"set",
"(",
"key",
",",
"value",
")",
"{",
"let",
"config",
"=",
"getGlobalConfig",
"(",
")",
";",
"if",
"(",
"key",
"&&",
"typeof",
"key",
"===",
"'string'",
"&&",
"typeof",
"value",
"!==",
"'undefined'",
")",
"{",
"config",
"=",
"_",
".... | set global .serverlessrc config value. | [
"set",
"global",
".",
"serverlessrc",
"config",
"value",
"."
] | 0626d5b5df06e4ed68969e324f1cb6b1b499c443 | https://github.com/serverless/serverless/blob/0626d5b5df06e4ed68969e324f1cb6b1b499c443/lib/utils/config/index.js#L66-L81 | train | Set the config | [
30522,
3853,
2275,
1006,
3145,
1010,
3643,
1007,
1063,
2292,
9530,
8873,
2290,
1027,
2131,
23296,
16429,
2389,
8663,
8873,
2290,
1006,
1007,
1025,
2065,
1006,
3145,
1004,
1004,
2828,
11253,
3145,
1027,
1027,
1027,
1005,
5164,
1005,
1004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
goldfire/howler.js | examples/sprite/sprite.js | function() {
var self = this;
// Loop through all active sounds and update their progress bar.
for (var i=0; i<self.sounds.length; i++) {
var id = parseInt(self.sounds[i].id, 10);
var offset = self._sprite[self.sounds[i].dataset.sprite][0];
var seek = (self.sound.seek(id) || 0) - (offset ... | javascript | function() {
var self = this;
// Loop through all active sounds and update their progress bar.
for (var i=0; i<self.sounds.length; i++) {
var id = parseInt(self.sounds[i].id, 10);
var offset = self._sprite[self.sounds[i].dataset.sprite][0];
var seek = (self.sound.seek(id) || 0) - (offset ... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"// Loop through all active sounds and update their progress bar.",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"self",
".",
"sounds",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"id",
... | The step called within requestAnimationFrame to update the playback positions. | [
"The",
"step",
"called",
"within",
"requestAnimationFrame",
"to",
"update",
"the",
"playback",
"positions",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/examples/sprite/sprite.js#L115-L127 | train | Update the progress bar | [
30522,
3853,
1006,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
1013,
1013,
7077,
2083,
2035,
3161,
4165,
1998,
10651,
2037,
5082,
3347,
1012,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
2969,
1012,
4165,
1012,
3091,
1025,
1045,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/LocaleData.js | function(sScale, iDiff, bFuture, sStyle) {
var sPattern, oTypes, sKey, sPluralCategory;
if (typeof bFuture === "string") {
sStyle = bFuture;
bFuture = undefined;
}
if (bFuture === undefined) {
bFuture = iDiff > 0;
}
if (sStyle === undefined) {
sStyle = "wide";
}
assert(sStyle... | javascript | function(sScale, iDiff, bFuture, sStyle) {
var sPattern, oTypes, sKey, sPluralCategory;
if (typeof bFuture === "string") {
sStyle = bFuture;
bFuture = undefined;
}
if (bFuture === undefined) {
bFuture = iDiff > 0;
}
if (sStyle === undefined) {
sStyle = "wide";
}
assert(sStyle... | [
"function",
"(",
"sScale",
",",
"iDiff",
",",
"bFuture",
",",
"sStyle",
")",
"{",
"var",
"sPattern",
",",
"oTypes",
",",
"sKey",
",",
"sPluralCategory",
";",
"if",
"(",
"typeof",
"bFuture",
"===",
"\"string\"",
")",
"{",
"sStyle",
"=",
"bFuture",
";",
... | Returns the relative format pattern with given scale (year, month, week, ...) and difference value.
@param {string} sScale the scale the relative pattern is needed for
@param {int} iDiff the difference in the given scale unit
@param {boolean} [bFuture] whether a future or past pattern should be used
@param {string} [s... | [
"Returns",
"the",
"relative",
"format",
"pattern",
"with",
"given",
"scale",
"(",
"year",
"month",
"week",
"...",
")",
"and",
"difference",
"value",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/LocaleData.js#L1140-L1171 | train | Returns the pattern for the given relative time type | [
30522,
3853,
1006,
7020,
9289,
2063,
1010,
8909,
13355,
1010,
28939,
4904,
5397,
1010,
7020,
27983,
1007,
1063,
13075,
14690,
16451,
1010,
27178,
18863,
2015,
1010,
15315,
3240,
1010,
11867,
7630,
7941,
16280,
20255,
2100,
1025,
2065,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
openlayers/openlayers | examples/animation.js | elastic | function elastic(t) {
return Math.pow(2, -10 * t) * Math.sin((t - 0.075) * (2 * Math.PI) / 0.3) + 1;
} | javascript | function elastic(t) {
return Math.pow(2, -10 * t) * Math.sin((t - 0.075) * (2 * Math.PI) / 0.3) + 1;
} | [
"function",
"elastic",
"(",
"t",
")",
"{",
"return",
"Math",
".",
"pow",
"(",
"2",
",",
"-",
"10",
"*",
"t",
")",
"*",
"Math",
".",
"sin",
"(",
"(",
"t",
"-",
"0.075",
")",
"*",
"(",
"2",
"*",
"Math",
".",
"PI",
")",
"/",
"0.3",
")",
"+",... | An elastic easing method (from https://github.com/DmitryBaranovskiy/raphael). | [
"An",
"elastic",
"easing",
"method",
"(",
"from",
"https",
":",
"//",
"github",
".",
"com",
"/",
"DmitryBaranovskiy",
"/",
"raphael",
")",
"."
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/examples/animation.js#L55-L57 | train | returns the elastic distance from t | [
30522,
3853,
21274,
1006,
1056,
1007,
1063,
2709,
8785,
1012,
23776,
1006,
1016,
1010,
1011,
2184,
1008,
1056,
1007,
1008,
8785,
1012,
8254,
1006,
1006,
1056,
1011,
1014,
1012,
5718,
2629,
1007,
1008,
1006,
1016,
1008,
8785,
1012,
14255,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/support/ToolsAPI.js | function (control) {
var properties = control.getMetadata().getAllProperties();
var propertiesBindingData = Object.create(null);
for (var key in properties) {
if (properties.hasOwnProperty(key) && control.getBinding(key)) {
propertiesBindingData[key] = Object.create(null);
propertiesBindin... | javascript | function (control) {
var properties = control.getMetadata().getAllProperties();
var propertiesBindingData = Object.create(null);
for (var key in properties) {
if (properties.hasOwnProperty(key) && control.getBinding(key)) {
propertiesBindingData[key] = Object.create(null);
propertiesBindin... | [
"function",
"(",
"control",
")",
"{",
"var",
"properties",
"=",
"control",
".",
"getMetadata",
"(",
")",
".",
"getAllProperties",
"(",
")",
";",
"var",
"propertiesBindingData",
"=",
"Object",
".",
"create",
"(",
"null",
")",
";",
"for",
"(",
"var",
"key"... | Creates an object with the properties bindings of a UI5 control.
@param {Object} control
@returns {Object}
@private | [
"Creates",
"an",
"object",
"with",
"the",
"properties",
"bindings",
"of",
"a",
"UI5",
"control",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/ToolsAPI.js#L317-L333 | train | Returns the binding data for a control | [
30522,
3853,
1006,
2491,
1007,
1063,
13075,
5144,
1027,
2491,
1012,
2131,
11368,
8447,
2696,
1006,
1007,
1012,
2131,
8095,
21572,
4842,
7368,
1006,
1007,
1025,
13075,
5144,
8428,
4667,
2850,
2696,
1027,
4874,
1012,
3443,
1006,
19701,
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... | |
adobe/brackets | src/utils/NodeConnection.js | function () { // failed this attempt, possibly try again
if (attemptCount < CONNECTION_ATTEMPTS) { //try again
// Calculate how long we should wait before trying again
var now = new Date();
var delay = Math.max(
... | javascript | function () { // failed this attempt, possibly try again
if (attemptCount < CONNECTION_ATTEMPTS) { //try again
// Calculate how long we should wait before trying again
var now = new Date();
var delay = Math.max(
... | [
"function",
"(",
")",
"{",
"// failed this attempt, possibly try again",
"if",
"(",
"attemptCount",
"<",
"CONNECTION_ATTEMPTS",
")",
"{",
"//try again",
"// Calculate how long we should wait before trying again",
"var",
"now",
"=",
"new",
"Date",
"(",
")",
";",
"var",
"... | succeded | [
"succeded"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/NodeConnection.js#L305-L317 | train | If we have too many attempts to connect then give up | [
30522,
3853,
1006,
1007,
1063,
1013,
1013,
3478,
2023,
3535,
1010,
4298,
3046,
2153,
2065,
1006,
3535,
3597,
16671,
1026,
4434,
1035,
4740,
1007,
1063,
1013,
1013,
3046,
2153,
1013,
1013,
18422,
2129,
2146,
2057,
2323,
3524,
2077,
2667,
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... | |
netlify/netlify-cms | packages/netlify-cms-widget-markdown/src/serializers/slateRemark.js | processLeaves | function processLeaves(leaf) {
/**
* Get an array of the mark types, converted to their MDAST equivalent
* types.
*/
const { marks = [], text } = leaf;
const markTypes = marks.map(mark => markMap[mark.type]);
if (typeof leaf.text === 'string') {
/**
* Code marks must be removed from the marks... | javascript | function processLeaves(leaf) {
/**
* Get an array of the mark types, converted to their MDAST equivalent
* types.
*/
const { marks = [], text } = leaf;
const markTypes = marks.map(mark => markMap[mark.type]);
if (typeof leaf.text === 'string') {
/**
* Code marks must be removed from the marks... | [
"function",
"processLeaves",
"(",
"leaf",
")",
"{",
"/**\n * Get an array of the mark types, converted to their MDAST equivalent\n * types.\n */",
"const",
"{",
"marks",
"=",
"[",
"]",
",",
"text",
"}",
"=",
"leaf",
";",
"const",
"markTypes",
"=",
"marks",
".",
... | Process Slate node leaves in preparation for MDAST transformation. | [
"Process",
"Slate",
"node",
"leaves",
"in",
"preparation",
"for",
"MDAST",
"transformation",
"."
] | 2488556590cbfdcefa626f2f2de01e7a160cf6ee | https://github.com/netlify/netlify-cms/blob/2488556590cbfdcefa626f2f2de01e7a160cf6ee/packages/netlify-cms-widget-markdown/src/serializers/slateRemark.js#L268-L286 | train | Process a leaf node. | [
30522,
3853,
2832,
19738,
6961,
1006,
7053,
1007,
1063,
1013,
1008,
1008,
1008,
2131,
2019,
9140,
1997,
1996,
2928,
4127,
1010,
4991,
2000,
2037,
9108,
14083,
5662,
1008,
4127,
1012,
1008,
1013,
9530,
3367,
1063,
6017,
1027,
1031,
1033,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js | function (mChangeListeners, sPath, oOldObject, oNewObject) {
if (!oNewObject) {
return;
}
// iterate over all properties in the old object
Object.keys(oOldObject).forEach(function (sProperty) {
var sPropertyPath = _Helper.buildPath(sPath, sProperty),
vOldProperty = oOldObject[sProperty],
... | javascript | function (mChangeListeners, sPath, oOldObject, oNewObject) {
if (!oNewObject) {
return;
}
// iterate over all properties in the old object
Object.keys(oOldObject).forEach(function (sProperty) {
var sPropertyPath = _Helper.buildPath(sPath, sProperty),
vOldProperty = oOldObject[sProperty],
... | [
"function",
"(",
"mChangeListeners",
",",
"sPath",
",",
"oOldObject",
",",
"oNewObject",
")",
"{",
"if",
"(",
"!",
"oNewObject",
")",
"{",
"return",
";",
"}",
"// iterate over all properties in the old object",
"Object",
".",
"keys",
"(",
"oOldObject",
")",
".",... | Updates the old object with the new object. Only existing properties of the old object
are updated. Fires change events for all changed properties. The function recursively
handles modified, added or removed structural properties and fires change events for all
modified/added/removed primitive properties therein. Colle... | [
"Updates",
"the",
"old",
"object",
"with",
"the",
"new",
"object",
".",
"Only",
"existing",
"properties",
"of",
"the",
"old",
"object",
"are",
"updated",
".",
"Fires",
"change",
"events",
"for",
"all",
"changed",
"properties",
".",
"The",
"function",
"recurs... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js#L1118-L1174 | train | Updates the properties in the new object | [
30522,
3853,
1006,
11338,
18003,
29282,
6528,
2545,
1010,
14690,
2232,
1010,
1051,
11614,
16429,
20614,
1010,
2028,
12155,
2497,
20614,
1007,
1063,
2065,
1006,
999,
2028,
12155,
2497,
20614,
1007,
1063,
2709,
1025,
1065,
1013,
1013,
2009,
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... | |
wangfupeng1988/wangEditor | src/js/text/index.js | function () {
const editor = this.editor
const $textElem = editor.$textElem
// 保存当前的选区
function saveRange(e) {
// 随时保存选区
editor.selection.saveRange()
// 更新按钮 ative 状态
editor.menus.changeActive()
}
// 按键后保存
$textElem... | javascript | function () {
const editor = this.editor
const $textElem = editor.$textElem
// 保存当前的选区
function saveRange(e) {
// 随时保存选区
editor.selection.saveRange()
// 更新按钮 ative 状态
editor.menus.changeActive()
}
// 按键后保存
$textElem... | [
"function",
"(",
")",
"{",
"const",
"editor",
"=",
"this",
".",
"editor",
"const",
"$textElem",
"=",
"editor",
".",
"$textElem",
"// 保存当前的选区",
"function",
"saveRange",
"(",
"e",
")",
"{",
"// 随时保存选区",
"editor",
".",
"selection",
".",
"saveRange",
"(",
")",... | 实时保存选取 | [
"实时保存选取"
] | b77696f5e81c8ec13d9d341252d6b9fa8a22db18 | https://github.com/wangfupeng1988/wangEditor/blob/b77696f5e81c8ec13d9d341252d6b9fa8a22db18/src/js/text/index.js#L148-L170 | train | Initialize the keypress events | [
30522,
3853,
1006,
1007,
1063,
9530,
3367,
3559,
1027,
2023,
1012,
3559,
9530,
3367,
1002,
3793,
12260,
2213,
1027,
3559,
1012,
1002,
3793,
12260,
2213,
1013,
1013,
1766,
100,
100,
1776,
1916,
100,
1782,
3853,
3828,
24388,
2063,
1006,
104... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
grpc/grpc-node | packages/grpc-native-core/src/server.js | sendUnaryResponse | function sendUnaryResponse(call, value, serialize, metadata, flags) {
var end_batch = {};
var statusMetadata = new Metadata();
var status = {
code: constants.status.OK,
details: 'OK'
};
if (metadata) {
statusMetadata = metadata;
}
var message;
try {
message = serialize(value);
} catch ... | javascript | function sendUnaryResponse(call, value, serialize, metadata, flags) {
var end_batch = {};
var statusMetadata = new Metadata();
var status = {
code: constants.status.OK,
details: 'OK'
};
if (metadata) {
statusMetadata = metadata;
}
var message;
try {
message = serialize(value);
} catch ... | [
"function",
"sendUnaryResponse",
"(",
"call",
",",
"value",
",",
"serialize",
",",
"metadata",
",",
"flags",
")",
"{",
"var",
"end_batch",
"=",
"{",
"}",
";",
"var",
"statusMetadata",
"=",
"new",
"Metadata",
"(",
")",
";",
"var",
"status",
"=",
"{",
"c... | Send a response to a unary or client streaming call.
@private
@param {grpc.Call} call The call to respond on
@param {*} value The value to respond with
@param {grpc~serialize} serialize Serialization function for the
response
@param {grpc.Metadata=} metadata Optional trailing metadata to send with
status
@param {number... | [
"Send",
"a",
"response",
"to",
"a",
"unary",
"or",
"client",
"streaming",
"call",
"."
] | b36b285f4cdb334bbd48f74c12c13bec69961488 | https://github.com/grpc/grpc-node/blob/b36b285f4cdb334bbd48f74c12c13bec69961488/packages/grpc-native-core/src/server.js#L83-L111 | train | Sends an unary response to the specified call. | [
30522,
3853,
4604,
9521,
2854,
6072,
26029,
3366,
1006,
2655,
30524,
3570,
1012,
7929,
1010,
4751,
1024,
1005,
7929,
1005,
1065,
1025,
2065,
1006,
27425,
1007,
1063,
3570,
11368,
8447,
2696,
1027,
27425,
1025,
1065,
13075,
4471,
1025,
3046,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/input/input.js | calculateInputValueLength | function calculateInputValueLength(value) {
value = ngTrim && !isPasswordInput && angular.isString(value) ? value.trim() : value;
if (value === undefined || value === null) {
value = '';
}
return String(value).length;
} | javascript | function calculateInputValueLength(value) {
value = ngTrim && !isPasswordInput && angular.isString(value) ? value.trim() : value;
if (value === undefined || value === null) {
value = '';
}
return String(value).length;
} | [
"function",
"calculateInputValueLength",
"(",
"value",
")",
"{",
"value",
"=",
"ngTrim",
"&&",
"!",
"isPasswordInput",
"&&",
"angular",
".",
"isString",
"(",
"value",
")",
"?",
"value",
".",
"trim",
"(",
")",
":",
"value",
";",
"if",
"(",
"value",
"===",... | Calculate the input value's length after coercing it to a string
and trimming it if appropriate.
@param value {*} the input's value
@returns {number} calculated length of the input's value | [
"Calculate",
"the",
"input",
"value",
"s",
"length",
"after",
"coercing",
"it",
"to",
"a",
"string",
"and",
"trimming",
"it",
"if",
"appropriate",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/input/input.js#L733-L739 | train | Calculates the length of the input value | [
30522,
3853,
18422,
2378,
18780,
10175,
16284,
13159,
2705,
1006,
3643,
1007,
1063,
3643,
1027,
12835,
18886,
2213,
1004,
1004,
999,
2003,
15194,
18351,
2378,
18780,
1004,
1004,
16108,
1012,
26354,
18886,
3070,
1006,
3643,
1007,
1029,
3643,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | lib/jsdoc/create-api-index.js | createSymbolSummaryForLib | function createSymbolSummaryForLib(lib) {
let file = path.join(unpackedTestresourcesRoot, lib.replace(/\./g, "/"), "designtime/api.json");
return readJSONFile(file).then(function (apijson) {
if (!apijson.hasOwnProperty("symbols") || !Array.isArray(apijson.symbols)) {
// Ignore libraries with invalid api.jso... | javascript | function createSymbolSummaryForLib(lib) {
let file = path.join(unpackedTestresourcesRoot, lib.replace(/\./g, "/"), "designtime/api.json");
return readJSONFile(file).then(function (apijson) {
if (!apijson.hasOwnProperty("symbols") || !Array.isArray(apijson.symbols)) {
// Ignore libraries with invalid api.jso... | [
"function",
"createSymbolSummaryForLib",
"(",
"lib",
")",
"{",
"let",
"file",
"=",
"path",
".",
"join",
"(",
"unpackedTestresourcesRoot",
",",
"lib",
".",
"replace",
"(",
"/",
"\\.",
"/",
"g",
",",
"\"/\"",
")",
",",
"\"designtime/api.json\"",
")",
";",
"r... | /*
Extracts main symbol information from a library api.json.
Also collects deprecated, experimental and since api's.
Returns a promise that resolves with an array of symbols. | [
"/",
"*",
"Extracts",
"main",
"symbol",
"information",
"from",
"a",
"library",
"api",
".",
"json",
".",
"Also",
"collects",
"deprecated",
"experimental",
"and",
"since",
"api",
"s",
".",
"Returns",
"a",
"promise",
"that",
"resolves",
"with",
"an",
"array",
... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/lib/jsdoc/create-api-index.js#L104-L129 | train | Create a symbol summary for a specific library | [
30522,
3853,
9005,
24335,
14956,
17421,
7849,
2100,
29278,
29521,
1006,
5622,
2497,
1007,
1063,
2292,
5371,
1027,
4130,
1012,
3693,
1006,
4895,
23947,
2098,
22199,
6072,
8162,
9623,
3217,
4140,
1010,
5622,
2497,
1012,
5672,
1006,
1013,
1032... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/utils/Async.js | waitForAll | function waitForAll(promises, failOnReject, timeout) {
var masterDeferred = new $.Deferred(),
results = [],
count = 0,
sawRejects = false;
if (!promises || promises.length === 0) {
masterDeferred.resolve();
return masterDeferred.promise();
... | javascript | function waitForAll(promises, failOnReject, timeout) {
var masterDeferred = new $.Deferred(),
results = [],
count = 0,
sawRejects = false;
if (!promises || promises.length === 0) {
masterDeferred.resolve();
return masterDeferred.promise();
... | [
"function",
"waitForAll",
"(",
"promises",
",",
"failOnReject",
",",
"timeout",
")",
"{",
"var",
"masterDeferred",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"results",
"=",
"[",
"]",
",",
"count",
"=",
"0",
",",
"sawRejects",
"=",
"false",
";",
... | Allows waiting for all the promises to be either resolved or rejected.
Unlike $.when(), it does not call .fail() or .always() handlers on first
reject. The caller should take all the precaution to make sure all the
promises passed to this function are completed to avoid blocking.
If failOnReject is set to true, promis... | [
"Allows",
"waiting",
"for",
"all",
"the",
"promises",
"to",
"be",
"either",
"resolved",
"or",
"rejected",
".",
"Unlike",
"$",
".",
"when",
"()",
"it",
"does",
"not",
"call",
".",
"fail",
"()",
"or",
".",
"always",
"()",
"handlers",
"on",
"first",
"reje... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/Async.js#L374-L413 | train | Wait for all the given promises to resolve or reject | [
30522,
3853,
3524,
29278,
8095,
1006,
10659,
1010,
8246,
2239,
2890,
20614,
1010,
2051,
5833,
1007,
1063,
13075,
3040,
3207,
7512,
5596,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1010,
3463,
1027,
1031,
1033,
1010,
4175,
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/core/Locale.js | getDesigntimePropertyAsArray | function getDesigntimePropertyAsArray(sValue) {
var m = /\$([-a-z0-9A-Z._]+)(?::([^$]*))?\$/.exec(sValue);
return (m && m[2]) ? m[2].split(/,/) : null;
} | javascript | function getDesigntimePropertyAsArray(sValue) {
var m = /\$([-a-z0-9A-Z._]+)(?::([^$]*))?\$/.exec(sValue);
return (m && m[2]) ? m[2].split(/,/) : null;
} | [
"function",
"getDesigntimePropertyAsArray",
"(",
"sValue",
")",
"{",
"var",
"m",
"=",
"/",
"\\$([-a-z0-9A-Z._]+)(?::([^$]*))?\\$",
"/",
".",
"exec",
"(",
"sValue",
")",
";",
"return",
"(",
"m",
"&&",
"m",
"[",
"2",
"]",
")",
"?",
"m",
"[",
"2",
"]",
".... | Helper to analyze and parse designtime variables
@private | [
"Helper",
"to",
"analyze",
"and",
"parse",
"designtime",
"variables"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Locale.js#L284-L287 | train | Parses the given designtime property value into an array of strings | [
30522,
3853,
2131,
6155,
23773,
7292,
21572,
4842,
21426,
10286,
9447,
1006,
17917,
2389,
5657,
1007,
1063,
13075,
1049,
1027,
1013,
1032,
1002,
1006,
1031,
1011,
1037,
1011,
1062,
2692,
1011,
1023,
2050,
1011,
1062,
1012,
1035,
1033,
1009,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/AutoUpdate/main.js | setupAutoUpdatePreference | function setupAutoUpdatePreference() {
PreferencesManager.definePreference("autoUpdate.AutoUpdate", "boolean", true, {
description: Strings.DESCRIPTION_AUTO_UPDATE
});
// Set or unset the auto update, based on preference state change
PreferencesManager.on("change", "autoUpda... | javascript | function setupAutoUpdatePreference() {
PreferencesManager.definePreference("autoUpdate.AutoUpdate", "boolean", true, {
description: Strings.DESCRIPTION_AUTO_UPDATE
});
// Set or unset the auto update, based on preference state change
PreferencesManager.on("change", "autoUpda... | [
"function",
"setupAutoUpdatePreference",
"(",
")",
"{",
"PreferencesManager",
".",
"definePreference",
"(",
"\"autoUpdate.AutoUpdate\"",
",",
"\"boolean\"",
",",
"true",
",",
"{",
"description",
":",
"Strings",
".",
"DESCRIPTION_AUTO_UPDATE",
"}",
")",
";",
"// Set or... | Defines preference to enable/disable Auto Update | [
"Defines",
"preference",
"to",
"enable",
"/",
"disable",
"Auto",
"Update"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L513-L528 | train | Setup auto update preference | [
30522,
3853,
16437,
4887,
24826,
17299,
3686,
28139,
25523,
1006,
1007,
1063,
18394,
24805,
4590,
1012,
9375,
28139,
25523,
1006,
1000,
8285,
6279,
13701,
1012,
8285,
6279,
13701,
1000,
1010,
1000,
22017,
20898,
1000,
1010,
2995,
1010,
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... |
GitbookIO/gitbook | lib/plugins/installPlugin.js | installPlugin | function installPlugin(book, plugin) {
var logger = book.getLogger();
var installFolder = book.getRoot();
var name = plugin.getName();
var requirement = plugin.getVersion();
logger.info.ln('');
logger.info.ln('installing plugin "' + name + '"');
// Find a version to install
return res... | javascript | function installPlugin(book, plugin) {
var logger = book.getLogger();
var installFolder = book.getRoot();
var name = plugin.getName();
var requirement = plugin.getVersion();
logger.info.ln('');
logger.info.ln('installing plugin "' + name + '"');
// Find a version to install
return res... | [
"function",
"installPlugin",
"(",
"book",
",",
"plugin",
")",
"{",
"var",
"logger",
"=",
"book",
".",
"getLogger",
"(",
")",
";",
"var",
"installFolder",
"=",
"book",
".",
"getRoot",
"(",
")",
";",
"var",
"name",
"=",
"plugin",
".",
"getName",
"(",
"... | Install a plugin for a book
@param {Book}
@param {PluginDependency}
@return {Promise} | [
"Install",
"a",
"plugin",
"for",
"a",
"book"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/plugins/installPlugin.js#L13-L45 | train | Install a plugin from NPM | [
30522,
3853,
16500,
24759,
15916,
2378,
1006,
2338,
1010,
13354,
2378,
1007,
1063,
13075,
8833,
4590,
1027,
2338,
1012,
2131,
21197,
4590,
1006,
1007,
1025,
13075,
16500,
10371,
2121,
1027,
2338,
1012,
2131,
3217,
4140,
1006,
1007,
1025,
13... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-js | lib/signers/v4_credentials.js | getSigningKey | function getSigningKey(
credentials,
date,
region,
service,
shouldCache
) {
var credsIdentifier = AWS.util.crypto
.hmac(credentials.secretAccessKey, credentials.accessKeyId, 'base64');
var cacheKey = [credsIdentifier, date, region, service].join('_');
shouldCache = shouldCache !=... | javascript | function getSigningKey(
credentials,
date,
region,
service,
shouldCache
) {
var credsIdentifier = AWS.util.crypto
.hmac(credentials.secretAccessKey, credentials.accessKeyId, 'base64');
var cacheKey = [credsIdentifier, date, region, service].join('_');
shouldCache = shouldCache !=... | [
"function",
"getSigningKey",
"(",
"credentials",
",",
"date",
",",
"region",
",",
"service",
",",
"shouldCache",
")",
"{",
"var",
"credsIdentifier",
"=",
"AWS",
".",
"util",
".",
"crypto",
".",
"hmac",
"(",
"credentials",
".",
"secretAccessKey",
",",
"creden... | @api private
@param credentials [Credentials]
@param date [String]
@param region [String]
@param service [String]
@param shouldCache [Boolean]
@return [String] | [
"@api",
"private"
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/signers/v4_credentials.js#L54-L88 | train | Get the signing key for the given credentials | [
30522,
3853,
4152,
23773,
2075,
14839,
1006,
22496,
1010,
3058,
1010,
2555,
1010,
2326,
1010,
2323,
3540,
5403,
1007,
1063,
13075,
13675,
2098,
7363,
16778,
8873,
2121,
1027,
22091,
2015,
1012,
21183,
4014,
1012,
19888,
2080,
1012,
20287,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/project/FileTreeView.js | _buildDirsFirstComparator | function _buildDirsFirstComparator(contents) {
function _dirsFirstCompare(a, b) {
var aIsFile = FileTreeViewModel.isFile(contents.get(a)),
bIsFile = FileTreeViewModel.isFile(contents.get(b));
if (!aIsFile && bIsFile) {
return -1;
} else if (aI... | javascript | function _buildDirsFirstComparator(contents) {
function _dirsFirstCompare(a, b) {
var aIsFile = FileTreeViewModel.isFile(contents.get(a)),
bIsFile = FileTreeViewModel.isFile(contents.get(b));
if (!aIsFile && bIsFile) {
return -1;
} else if (aI... | [
"function",
"_buildDirsFirstComparator",
"(",
"contents",
")",
"{",
"function",
"_dirsFirstCompare",
"(",
"a",
",",
"b",
")",
"{",
"var",
"aIsFile",
"=",
"FileTreeViewModel",
".",
"isFile",
"(",
"contents",
".",
"get",
"(",
"a",
")",
")",
",",
"bIsFile",
"... | @private
Creates a comparison function for sorting a directory's contents with directories
appearing before files.
We're sorting the keys of the directory (the names) based partly on the values,
so we use a closure to capture the map itself so that we can look up the
values as needed.
@param {Immutable.Map} contents... | [
"@private"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L665-L679 | train | Build a comparator function for directories first | [
30522,
3853,
1035,
3857,
4305,
2869,
8873,
12096,
9006,
28689,
4263,
1006,
8417,
1007,
1063,
3853,
1035,
16101,
22747,
18894,
13535,
25377,
12069,
1006,
1037,
1010,
1038,
1007,
1063,
13075,
9932,
22747,
9463,
1027,
5371,
13334,
8584,
5302,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.layout/src/sap/ui/layout/Splitter.js | _ensureLayoutData | function _ensureLayoutData(oContent) {
var oLd = oContent.getLayoutData();
// Make sure LayoutData is set on the content
// But this approach has the advantage that "compatible" LayoutData can be used.
if (oLd && (!oLd.getResizable || !oLd.getSize || !oLd.getMinSize)) {
Log.warning(
"Content \"" + oConte... | javascript | function _ensureLayoutData(oContent) {
var oLd = oContent.getLayoutData();
// Make sure LayoutData is set on the content
// But this approach has the advantage that "compatible" LayoutData can be used.
if (oLd && (!oLd.getResizable || !oLd.getSize || !oLd.getMinSize)) {
Log.warning(
"Content \"" + oConte... | [
"function",
"_ensureLayoutData",
"(",
"oContent",
")",
"{",
"var",
"oLd",
"=",
"oContent",
".",
"getLayoutData",
"(",
")",
";",
"// Make sure LayoutData is set on the content",
"// But this approach has the advantage that \"compatible\" LayoutData can be used.",
"if",
"(",
"oLd... | Makes sure the LayoutData for the given control is set and compatible. In case nothing is set,
a default sap.ui.layout.SplitterLayoutData is set on the Element
@param {sap.ui.core.Element} [oContent] The Element for which the existance of LayoutData should be ensured
@private | [
"Makes",
"sure",
"the",
"LayoutData",
"for",
"the",
"given",
"control",
"is",
"set",
"and",
"compatible",
".",
"In",
"case",
"nothing",
"is",
"set",
"a",
"default",
"sap",
".",
"ui",
".",
"layout",
".",
"SplitterLayoutData",
"is",
"set",
"on",
"the",
"El... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.layout/src/sap/ui/layout/Splitter.js#L1105-L1119 | train | Ensure that the LayoutData of the Splitter is set on the given content. | [
30522,
3853,
1035,
5676,
8485,
5833,
2850,
2696,
1006,
1051,
8663,
6528,
2102,
1007,
1063,
13075,
2214,
1027,
1051,
8663,
6528,
2102,
1012,
2131,
8485,
5833,
2850,
2696,
1006,
1007,
1025,
1013,
1013,
2191,
2469,
9621,
2850,
2696,
2003,
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... |
GitbookIO/gitbook | lib/output/modifiers/svgToPng.js | svgToPng | function svgToPng(rootFolder, currentFile, $) {
var currentDirectory = path.dirname(currentFile);
return editHTMLElement($, 'img', function($img) {
var src = $img.attr('src');
if (path.extname(src) !== '.svg') {
return;
}
// Calcul absolute path for this
src... | javascript | function svgToPng(rootFolder, currentFile, $) {
var currentDirectory = path.dirname(currentFile);
return editHTMLElement($, 'img', function($img) {
var src = $img.attr('src');
if (path.extname(src) !== '.svg') {
return;
}
// Calcul absolute path for this
src... | [
"function",
"svgToPng",
"(",
"rootFolder",
",",
"currentFile",
",",
"$",
")",
"{",
"var",
"currentDirectory",
"=",
"path",
".",
"dirname",
"(",
"currentFile",
")",
";",
"return",
"editHTMLElement",
"(",
"$",
",",
"'img'",
",",
"function",
"(",
"$img",
")",... | Convert all SVG images to PNG
@param {String} rootFolder
@param {HTMLDom} $
@return {Promise} | [
"Convert",
"all",
"SVG",
"images",
"to",
"PNG"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/output/modifiers/svgToPng.js#L17-L50 | train | Convert SVG file to PNG | [
30522,
3853,
17917,
13512,
7361,
3070,
1006,
7117,
10371,
2121,
1010,
2783,
8873,
2571,
1010,
1002,
1007,
1063,
13075,
2783,
4305,
2890,
16761,
2100,
1027,
4130,
1012,
16101,
18442,
1006,
2783,
8873,
2571,
1007,
1025,
2709,
13257,
21246,
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... |
SAP/openui5 | lib/jsdoc/transform-apijson-for-sdk.js | function (oChainObject) {
function isBuiltInType(type) {
return formatters._baseTypes.indexOf(type) >= 0;
}
/**
* Heuristically determining if there is a possibility the given input string
* to be a UI5 symbol
* @param {string} sName
* @returns {boolean}
*/
function possibleUI5Symbol(sName) {... | javascript | function (oChainObject) {
function isBuiltInType(type) {
return formatters._baseTypes.indexOf(type) >= 0;
}
/**
* Heuristically determining if there is a possibility the given input string
* to be a UI5 symbol
* @param {string} sName
* @returns {boolean}
*/
function possibleUI5Symbol(sName) {... | [
"function",
"(",
"oChainObject",
")",
"{",
"function",
"isBuiltInType",
"(",
"type",
")",
"{",
"return",
"formatters",
".",
"_baseTypes",
".",
"indexOf",
"(",
"type",
")",
">=",
"0",
";",
"}",
"/**\n\t\t * Heuristically determining if there is a possibility the given ... | Transforms api.json file
@param {object} oChainObject chain object | [
"Transforms",
"api",
".",
"json",
"file"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/lib/jsdoc/transform-apijson-for-sdk.js#L61-L683 | train | Checks if the given string is a built - in type of symbol | [
30522,
3853,
1006,
28166,
8113,
16429,
20614,
1007,
1063,
3853,
2003,
8569,
4014,
7629,
13874,
1006,
2828,
1007,
1063,
2709,
4289,
7747,
1012,
1035,
2918,
13874,
2015,
1012,
5950,
11253,
1006,
2828,
1007,
1028,
1027,
1014,
1025,
1065,
1013,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
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 - no... | 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 - no... | [
"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... |
mochajs/mocha | lib/runnable.js | multiple | function multiple(err) {
if (emitted) {
return;
}
emitted = true;
var msg = 'done() called multiple times';
if (err && err.message) {
err.message += " (and Mocha's " + msg + ')';
self.emit('error', err);
} else {
self.emit('error', new Error(msg));
}
} | javascript | function multiple(err) {
if (emitted) {
return;
}
emitted = true;
var msg = 'done() called multiple times';
if (err && err.message) {
err.message += " (and Mocha's " + msg + ')';
self.emit('error', err);
} else {
self.emit('error', new Error(msg));
}
} | [
"function",
"multiple",
"(",
"err",
")",
"{",
"if",
"(",
"emitted",
")",
"{",
"return",
";",
"}",
"emitted",
"=",
"true",
";",
"var",
"msg",
"=",
"'done() called multiple times'",
";",
"if",
"(",
"err",
"&&",
"err",
".",
"message",
")",
"{",
"err",
"... | called multiple times | [
"called",
"multiple",
"times"
] | 9b00fedb610241e33f7592c40164e42a38a793cf | https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/runnable.js#L303-L315 | train | Called when a single task is called | [
30522,
3853,
3674,
1006,
9413,
2099,
1007,
1063,
2065,
1006,
22627,
1007,
1063,
2709,
1025,
1065,
22627,
1027,
2995,
1025,
13075,
5796,
2290,
1027,
1005,
2589,
1006,
1007,
2170,
3674,
2335,
1005,
1025,
2065,
1006,
9413,
2099,
1004,
1004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dcloudio/mui | examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js | function () {
// Ensure that there is no open WebSocket from a previous Connection.
this._closeSocket();
// Create the new WobSocket
this.socket = new WebSocket(this._conn.service, "xmpp");
this.socket.onopen = this._onOpen.bind(this);
this.socket.onerror = this._... | javascript | function () {
// Ensure that there is no open WebSocket from a previous Connection.
this._closeSocket();
// Create the new WobSocket
this.socket = new WebSocket(this._conn.service, "xmpp");
this.socket.onopen = this._onOpen.bind(this);
this.socket.onerror = this._... | [
"function",
"(",
")",
"{",
"// Ensure that there is no open WebSocket from a previous Connection.\r",
"this",
".",
"_closeSocket",
"(",
")",
";",
"// Create the new WobSocket\r",
"this",
".",
"socket",
"=",
"new",
"WebSocket",
"(",
"this",
".",
"_conn",
".",
"service",
... | PrivateFunction: _connect
_Private_ function called by Strophe.Connection.connect
Creates a WebSocket for a connection and assigns Callbacks to it.
Does nothing if there already is a WebSocket. | [
"PrivateFunction",
":",
"_connect",
"_Private_",
"function",
"called",
"by",
"Strophe",
".",
"Connection",
".",
"connect"
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/login/libs/easymob-webim-sdk/strophe-custom-2.0.0.js#L4862-L4872 | train | Called when the connection is established | [
30522,
3853,
1006,
1007,
1063,
1013,
1013,
5676,
2008,
2045,
2003,
2053,
2330,
4773,
6499,
19869,
2102,
2013,
1037,
3025,
4434,
1012,
2023,
1012,
1035,
14572,
7432,
3388,
1006,
1007,
1025,
1013,
1013,
3443,
1996,
2047,
24185,
5910,
7432,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SheetJS/js-xlsx | xlsx.js | parse_Ref8U | function parse_Ref8U(blob) {
var rwFirst = blob.read_shift(2);
var rwLast = blob.read_shift(2);
var colFirst = blob.read_shift(2);
var colLast = blob.read_shift(2);
return {s:{c:colFirst, r:rwFirst}, e:{c:colLast,r:rwLast}};
} | javascript | function parse_Ref8U(blob) {
var rwFirst = blob.read_shift(2);
var rwLast = blob.read_shift(2);
var colFirst = blob.read_shift(2);
var colLast = blob.read_shift(2);
return {s:{c:colFirst, r:rwFirst}, e:{c:colLast,r:rwLast}};
} | [
"function",
"parse_Ref8U",
"(",
"blob",
")",
"{",
"var",
"rwFirst",
"=",
"blob",
".",
"read_shift",
"(",
"2",
")",
";",
"var",
"rwLast",
"=",
"blob",
".",
"read_shift",
"(",
"2",
")",
";",
"var",
"colFirst",
"=",
"blob",
".",
"read_shift",
"(",
"2",
... | /* [MS-XLS] 2.5.209 TODO: Check sizes | [
"/",
"*",
"[",
"MS",
"-",
"XLS",
"]",
"2",
".",
"5",
".",
"209",
"TODO",
":",
"Check",
"sizes"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L5625-L5631 | train | Parse a Ref8U | [
30522,
3853,
11968,
3366,
1035,
25416,
2620,
2226,
1006,
1038,
4135,
2497,
1007,
1063,
13075,
1054,
2860,
8873,
12096,
1027,
1038,
4135,
2497,
1012,
3191,
1035,
5670,
1006,
1016,
1007,
1025,
13075,
1054,
13668,
14083,
1027,
1038,
4135,
2497... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | range | function range(start, end)
{
if (arguments.length == 1) {
var end = start;
start = 0;
}
var r = [];
if (start < end) {
while (start != end)
r.push(start++);
}
else {
while (start != end)
r.push(start--);
}
return r;
} | javascript | function range(start, end)
{
if (arguments.length == 1) {
var end = start;
start = 0;
}
var r = [];
if (start < end) {
while (start != end)
r.push(start++);
}
else {
while (start != end)
r.push(start--);
}
return r;
} | [
"function",
"range",
"(",
"start",
",",
"end",
")",
"{",
"if",
"(",
"arguments",
".",
"length",
"==",
"1",
")",
"{",
"var",
"end",
"=",
"start",
";",
"start",
"=",
"0",
";",
"}",
"var",
"r",
"=",
"[",
"]",
";",
"if",
"(",
"start",
"<",
"end",... | Emulates python's range() built-in. Returns an array of integers, counting
up (or down) from start to end. Note that the range returned is up to, but
NOT INCLUDING, end.
.
@param start integer from which to start counting. If the end parameter is
not provided, this value is considered the end and start will
be zero.
@... | [
"Emulates",
"python",
"s",
"range",
"()",
"built",
"-",
"in",
".",
"Returns",
"an",
"array",
"of",
"integers",
"counting",
"up",
"(",
"or",
"down",
")",
"from",
"start",
"to",
"end",
".",
"Note",
"that",
"the",
"range",
"returned",
"is",
"up",
"to",
... | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/htmlutils.js#L2455-L2472 | train | returns an array of the ids of the terms | [
30522,
3853,
2846,
1006,
2707,
1010,
2203,
1007,
1063,
2065,
1006,
9918,
1012,
3091,
1027,
1027,
1015,
1007,
1063,
13075,
2203,
1027,
2707,
1025,
2707,
1027,
1014,
1025,
1065,
13075,
1054,
1027,
1031,
1033,
1025,
2065,
1006,
2707,
1026,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/JavaScriptRefactoring/RefactoringUtils.js | findSurroundASTNode | function findSurroundASTNode(ast, expn, types) {
var foundNode = ASTWalker.findNodeAround(ast, expn.start, function (nodeType, node) {
if (expn.end) {
return types.includes(nodeType) && node.end >= expn.end;
} else {
return types.includes(nodeType);
... | javascript | function findSurroundASTNode(ast, expn, types) {
var foundNode = ASTWalker.findNodeAround(ast, expn.start, function (nodeType, node) {
if (expn.end) {
return types.includes(nodeType) && node.end >= expn.end;
} else {
return types.includes(nodeType);
... | [
"function",
"findSurroundASTNode",
"(",
"ast",
",",
"expn",
",",
"types",
")",
"{",
"var",
"foundNode",
"=",
"ASTWalker",
".",
"findNodeAround",
"(",
"ast",
",",
"expn",
".",
"start",
",",
"function",
"(",
"nodeType",
",",
"node",
")",
"{",
"if",
"(",
... | Finds the surrounding ast node of the given expression of any of the given types
@param {!ASTNode} ast
@param {!{start: number, end: number}} expn - contains start and end offsets of expn
@param {!Array.<string>} types
@return {?ASTNode} | [
"Finds",
"the",
"surrounding",
"ast",
"node",
"of",
"the",
"given",
"expression",
"of",
"any",
"of",
"the",
"given",
"types"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptRefactoring/RefactoringUtils.js#L322-L331 | train | Find surround AST node | [
30522,
3853,
4858,
3126,
22494,
8943,
3367,
3630,
3207,
1006,
2004,
2102,
1010,
4654,
2361,
2078,
1010,
4127,
1007,
1063,
13075,
2179,
3630,
3207,
1027,
2004,
2102,
26965,
1012,
2424,
3630,
3207,
24490,
1006,
2004,
2102,
1010,
4654,
2361,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-amplify/amplify-js | packages/amazon-cognito-identity-js/src/BigInteger.js | bnpDRShiftTo | function bnpDRShiftTo(n, r) {
for (var i = n; i < this.t; ++i)
r[i - n] = this[i];
r.t = Math.max(this.t - n, 0);
r.s = this.s;
} | javascript | function bnpDRShiftTo(n, r) {
for (var i = n; i < this.t; ++i)
r[i - n] = this[i];
r.t = Math.max(this.t - n, 0);
r.s = this.s;
} | [
"function",
"bnpDRShiftTo",
"(",
"n",
",",
"r",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"n",
";",
"i",
"<",
"this",
".",
"t",
";",
"++",
"i",
")",
"r",
"[",
"i",
"-",
"n",
"]",
"=",
"this",
"[",
"i",
"]",
";",
"r",
".",
"t",
"=",
"Math",... | (protected) r = this >> n*DB | [
"(",
"protected",
")",
"r",
"=",
"this",
">>",
"n",
"*",
"DB"
] | db55ff3dff31c64a246180f39eb0a04a89fd16e1 | https://github.com/aws-amplify/amplify-js/blob/db55ff3dff31c64a246180f39eb0a04a89fd16e1/packages/amazon-cognito-identity-js/src/BigInteger.js#L327-L332 | train | Shifts the sequence by n to the end of the sequence | [
30522,
3853,
24869,
17299,
2869,
4048,
6199,
3406,
1006,
1050,
1010,
1054,
1007,
1063,
2005,
1006,
13075,
1045,
1027,
30524,
2023,
1012,
1056,
1025,
1009,
1009,
1045,
1007,
1054,
1031,
1045,
1011,
1050,
1033,
1027,
2023,
1031,
1045,
1033,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dequelabs/axe-core | lib/core/utils/get-xpath.js | getXPathArray | function getXPathArray(node, path) {
var sibling, count;
// Gets an XPath for an element which describes its hierarchical location.
if (!node) {
return [];
}
if (!path && node.nodeType === 9) {
// special case for when we are called and give the document itself as the starting node
path = [
{
str: 'ht... | javascript | function getXPathArray(node, path) {
var sibling, count;
// Gets an XPath for an element which describes its hierarchical location.
if (!node) {
return [];
}
if (!path && node.nodeType === 9) {
// special case for when we are called and give the document itself as the starting node
path = [
{
str: 'ht... | [
"function",
"getXPathArray",
"(",
"node",
",",
"path",
")",
"{",
"var",
"sibling",
",",
"count",
";",
"// Gets an XPath for an element which describes its hierarchical location.",
"if",
"(",
"!",
"node",
")",
"{",
"return",
"[",
"]",
";",
"}",
"if",
"(",
"!",
... | /*global axe | [
"/",
"*",
"global",
"axe"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/utils/get-xpath.js#L3-L63 | train | Returns an array of XPath expression nodes that are closest to the given node. | [
30522,
3853,
2131,
2595,
15069,
2906,
9447,
1006,
13045,
1010,
4130,
1007,
1063,
13075,
22941,
1010,
4175,
1025,
1013,
1013,
4152,
2019,
26726,
8988,
2005,
2019,
5783,
2029,
5577,
2049,
25835,
3295,
1012,
2065,
1006,
999,
13045,
1007,
1063,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/AnnotationHelper.js | chain | function chain(fnAfter, fnBefore) {
if (!fnBefore) {
return fnAfter;
}
function formatter() {
return fnAfter.call(this, fnBefore.apply(this, arguments));
}
return formatter;
} | javascript | function chain(fnAfter, fnBefore) {
if (!fnBefore) {
return fnAfter;
}
function formatter() {
return fnAfter.call(this, fnBefore.apply(this, arguments));
}
return formatter;
} | [
"function",
"chain",
"(",
"fnAfter",
",",
"fnBefore",
")",
"{",
"if",
"(",
"!",
"fnBefore",
")",
"{",
"return",
"fnAfter",
";",
"}",
"function",
"formatter",
"(",
")",
"{",
"return",
"fnAfter",
".",
"call",
"(",
"this",
",",
"fnBefore",
".",
"apply",
... | Returns a function representing the composition <code>fnAfter</code> after
<code>fnBefore</code>.
@param {function} fnAfter
the second function, taking a single argument
@param {function} [fnBefore]
the optional first function, taking multiple arguments
@returns {function}
the composition <code>fnAfter</code> after <c... | [
"Returns",
"a",
"function",
"representing",
"the",
"composition",
"<code",
">",
"fnAfter<",
"/",
"code",
">",
"after",
"<code",
">",
"fnBefore<",
"/",
"code",
">",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/AnnotationHelper.js#L25-L34 | train | Chain a function to a function | [
30522,
3853,
4677,
1006,
1042,
2532,
6199,
2121,
1010,
1042,
27698,
12879,
5686,
1007,
1063,
2065,
1006,
999,
1042,
27698,
12879,
5686,
1007,
1063,
2709,
1042,
2532,
6199,
2121,
1025,
1065,
3853,
4289,
3334,
1006,
1007,
1063,
2709,
1042,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.