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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/localization.js | filterCroppedNodes | function filterCroppedNodes(node) {
if (!node.boxObject) {
return domUtils.DOMWalker.FILTER_SKIP;
} else {
if (!node.disabled && !node.collapsed && !node.hidden) {
// Code specific to the preferences panes to reject out not visible nodes
// in the panes.
if (node.parentNode && (node.parent... | javascript | function filterCroppedNodes(node) {
if (!node.boxObject) {
return domUtils.DOMWalker.FILTER_SKIP;
} else {
if (!node.disabled && !node.collapsed && !node.hidden) {
// Code specific to the preferences panes to reject out not visible nodes
// in the panes.
if (node.parentNode && (node.parent... | [
"function",
"filterCroppedNodes",
"(",
"node",
")",
"{",
"if",
"(",
"!",
"node",
".",
"boxObject",
")",
"{",
"return",
"domUtils",
".",
"DOMWalker",
".",
"FILTER_SKIP",
";",
"}",
"else",
"{",
"if",
"(",
"!",
"node",
".",
"disabled",
"&&",
"!",
"node",
... | Filters out nodes which should not be tested because they are not visible
@param {node} node
@returns Filter status of the given node
@type {array of array of int} | [
"Filters",
"out",
"nodes",
"which",
"should",
"not",
"be",
"tested",
"because",
"they",
"are",
"not",
"visible"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/localization.js#L224-L246 | train | filterCroppedNodes - filter out nodes that are not visible in the preferences panes | [
30522,
3853,
11307,
26775,
27288,
3630,
6155,
1006,
13045,
1007,
1063,
2065,
1006,
999,
13045,
1012,
3482,
16429,
20614,
30524,
1012,
9776,
1004,
1004,
999,
13045,
1012,
7798,
1004,
1004,
999,
13045,
1012,
5023,
1007,
1063,
1013,
1013,
3642... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
pagekit/vue-resource | dist/vue-resource.esm.js | Client | function Client (context) {
var reqHandlers = [sendRequest], resHandlers = [];
if (!isObject(context)) {
context = null;
}
function Client(request) {
while (reqHandlers.length) {
var handler = reqHandlers.pop();
if (isFunction(handler)) {
var... | javascript | function Client (context) {
var reqHandlers = [sendRequest], resHandlers = [];
if (!isObject(context)) {
context = null;
}
function Client(request) {
while (reqHandlers.length) {
var handler = reqHandlers.pop();
if (isFunction(handler)) {
var... | [
"function",
"Client",
"(",
"context",
")",
"{",
"var",
"reqHandlers",
"=",
"[",
"sendRequest",
"]",
",",
"resHandlers",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"isObject",
"(",
"context",
")",
")",
"{",
"context",
"=",
"null",
";",
"}",
"function",
"Clie... | Base client. | [
"Base",
"client",
"."
] | fe268fa1d6053ede5f34aef9a11e1a424a70446c | https://github.com/pagekit/vue-resource/blob/fe268fa1d6053ede5f34aef9a11e1a424a70446c/dist/vue-resource.esm.js#L1126-L1174 | train | A client that can be used to send requests to the server | [
30522,
3853,
7396,
1006,
6123,
1007,
1063,
13075,
2128,
4160,
11774,
12910,
1027,
1031,
4604,
2890,
15500,
1033,
1010,
24501,
11774,
12910,
1027,
1031,
1033,
1025,
2065,
1006,
999,
11163,
2497,
20614,
1006,
6123,
1007,
1007,
1063,
6123,
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... |
cytoscape/cytoscape.js | dist/cytoscape.esm.js | addConnectedEdges | function addConnectedEdges(node) {
var edges = node._private.edges;
for (var i = 0; i < edges.length; i++) {
add(edges[i]);
}
} | javascript | function addConnectedEdges(node) {
var edges = node._private.edges;
for (var i = 0; i < edges.length; i++) {
add(edges[i]);
}
} | [
"function",
"addConnectedEdges",
"(",
"node",
")",
"{",
"var",
"edges",
"=",
"node",
".",
"_private",
".",
"edges",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"edges",
".",
"length",
";",
"i",
"++",
")",
"{",
"add",
"(",
"edges",
"[",
... | add connected edges | [
"add",
"connected",
"edges"
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L12352-L12358 | train | Add connected edges to the node | [
30522,
3853,
5587,
24230,
24225,
2015,
1006,
13045,
1007,
1063,
13075,
7926,
1027,
13045,
1012,
1035,
2797,
1012,
7926,
1025,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
7926,
1012,
3091,
1025,
1045,
1009,
1009,
1007,
1063,
5587,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/CodeInspection.js | inspectFile | function inspectFile(file, providerList) {
var response = new $.Deferred(),
results = [];
providerList = providerList || getProvidersForPath(file.fullPath);
if (!providerList.length) {
response.resolve(null);
return response.promise();
}
Doc... | javascript | function inspectFile(file, providerList) {
var response = new $.Deferred(),
results = [];
providerList = providerList || getProvidersForPath(file.fullPath);
if (!providerList.length) {
response.resolve(null);
return response.promise();
}
Doc... | [
"function",
"inspectFile",
"(",
"file",
",",
"providerList",
")",
"{",
"var",
"response",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"results",
"=",
"[",
"]",
";",
"providerList",
"=",
"providerList",
"||",
"getProvidersForPath",
"(",
"file",
".",
... | Runs a file inspection over passed file. Uses the given list of providers if specified, otherwise uses
the set of providers that are registered for the file's language.
This method doesn't update the Brackets UI, just provides inspection results.
These results will reflect any unsaved changes present in the file if cur... | [
"Runs",
"a",
"file",
"inspection",
"over",
"passed",
"file",
".",
"Uses",
"the",
"given",
"list",
"of",
"providers",
"if",
"specified",
"otherwise",
"uses",
"the",
"set",
"of",
"providers",
"that",
"are",
"registered",
"for",
"the",
"file",
"s",
"language",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CodeInspection.js#L220-L305 | train | Inspects a file using a list of providers | [
30522,
3853,
22459,
8873,
2571,
1006,
5371,
1010,
10802,
9863,
1007,
1063,
13075,
3433,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1010,
3463,
1027,
1031,
1033,
1025,
10802,
9863,
1027,
10802,
9863,
1064,
1064,
2131,
21572,
172... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
lovell/sharp | lib/output.js | toFile | function toFile (fileOut, callback) {
if (!fileOut || fileOut.length === 0) {
const errOutputInvalid = new Error('Missing output file path');
if (is.fn(callback)) {
callback(errOutputInvalid);
} else {
return Promise.reject(errOutputInvalid);
}
} else {
if (this.options.input.file ==... | javascript | function toFile (fileOut, callback) {
if (!fileOut || fileOut.length === 0) {
const errOutputInvalid = new Error('Missing output file path');
if (is.fn(callback)) {
callback(errOutputInvalid);
} else {
return Promise.reject(errOutputInvalid);
}
} else {
if (this.options.input.file ==... | [
"function",
"toFile",
"(",
"fileOut",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"fileOut",
"||",
"fileOut",
".",
"length",
"===",
"0",
")",
"{",
"const",
"errOutputInvalid",
"=",
"new",
"Error",
"(",
"'Missing output file path'",
")",
";",
"if",
"(",
"i... | Write output image data to a file.
If an explicit output format is not selected, it will be inferred from the extension,
with JPEG, PNG, WebP, TIFF, DZI, and libvips' V format supported.
Note that raw pixel data is only supported for buffer output.
A `Promise` is returned when `callback` is not provided.
@example
sh... | [
"Write",
"output",
"image",
"data",
"to",
"a",
"file",
"."
] | 05d76eeadfe54713606a615185b2da047923406b | https://github.com/lovell/sharp/blob/05d76eeadfe54713606a615185b2da047923406b/lib/output.js#L33-L55 | train | Create a new file in the current project | [
30522,
3853,
2000,
8873,
2571,
1006,
5371,
5833,
1010,
2655,
5963,
1007,
1063,
2065,
1006,
999,
5371,
5833,
1064,
1064,
5371,
5833,
1012,
3091,
1027,
1027,
1027,
1014,
1007,
1063,
9530,
3367,
9413,
22494,
25856,
21823,
2078,
10175,
3593,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ccxt/ccxt | build/transpile.js | transpileDerivedExchangeFile | function transpileDerivedExchangeFile (folder, filename) {
try {
let contents = fs.readFileSync (folder + filename, 'utf8')
let { python2, python3, php, className, baseClass } = transpileDerivedExchangeClass (contents)
const python2Filename = python2Folder + filename.replace ('.js', '.py... | javascript | function transpileDerivedExchangeFile (folder, filename) {
try {
let contents = fs.readFileSync (folder + filename, 'utf8')
let { python2, python3, php, className, baseClass } = transpileDerivedExchangeClass (contents)
const python2Filename = python2Folder + filename.replace ('.js', '.py... | [
"function",
"transpileDerivedExchangeFile",
"(",
"folder",
",",
"filename",
")",
"{",
"try",
"{",
"let",
"contents",
"=",
"fs",
".",
"readFileSync",
"(",
"folder",
"+",
"filename",
",",
"'utf8'",
")",
"let",
"{",
"python2",
",",
"python3",
",",
"php",
",",... | ---------------------------------------------------------------------------- | [
"----------------------------------------------------------------------------"
] | 8168069b9180a465532905e225586215e115a565 | https://github.com/ccxt/ccxt/blob/8168069b9180a465532905e225586215e115a565/build/transpile.js#L698-L724 | train | transpiles a file from a folder | [
30522,
3853,
9099,
22090,
4063,
3512,
3207,
2595,
22305,
12879,
9463,
1006,
19622,
1010,
5371,
18442,
1007,
1063,
3046,
1063,
2292,
8417,
1027,
1042,
2015,
1012,
3191,
8873,
4244,
6038,
2278,
1006,
19622,
1009,
5371,
18442,
1010,
1005,
2118... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | listDescendant | function listDescendant(node, pred) {
const descendants = [];
pred = pred || func.ok;
// start DFS(depth first search) with node
(function fnWalk(current) {
if (node !== current && pred(current)) {
descendants.push(current);
}
for (let idx = 0, len = current.childNodes.length; idx < len; idx+... | javascript | function listDescendant(node, pred) {
const descendants = [];
pred = pred || func.ok;
// start DFS(depth first search) with node
(function fnWalk(current) {
if (node !== current && pred(current)) {
descendants.push(current);
}
for (let idx = 0, len = current.childNodes.length; idx < len; idx+... | [
"function",
"listDescendant",
"(",
"node",
",",
"pred",
")",
"{",
"const",
"descendants",
"=",
"[",
"]",
";",
"pred",
"=",
"pred",
"||",
"func",
".",
"ok",
";",
"// start DFS(depth first search) with node",
"(",
"function",
"fnWalk",
"(",
"current",
")",
"{"... | listing descendant nodes
@param {Node} node
@param {Function} [pred] - predicate function | [
"listing",
"descendant",
"nodes"
] | 8dcafb8107453006b905ef697a529c42e76beb3f | https://github.com/summernote/summernote/blob/8dcafb8107453006b905ef697a529c42e76beb3f/src/js/base/core/dom.js#L352-L367 | train | List descendant nodes of node | [
30522,
3853,
2862,
6155,
23865,
4630,
1006,
13045,
1010,
3653,
2094,
1007,
1063,
9530,
3367,
8481,
1027,
1031,
1033,
1025,
3653,
2094,
1027,
3653,
2094,
1064,
1064,
4569,
2278,
1012,
7929,
1025,
1013,
1013,
2707,
1040,
10343,
1006,
5995,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/hyphenation/Hyphenation.js | prepareConfig | function prepareConfig(sLanguage, oConfig) {
//Creating default configuration
var oConfigurationForLanguage = {
"require": [sLanguage],
"hyphen": "\u00AD",
"leftmin": 3, // The minimum of chars to remain on the old line.
"rightmin": 3,// The minimum of chars to go on the new line
"compound": "all", /... | javascript | function prepareConfig(sLanguage, oConfig) {
//Creating default configuration
var oConfigurationForLanguage = {
"require": [sLanguage],
"hyphen": "\u00AD",
"leftmin": 3, // The minimum of chars to remain on the old line.
"rightmin": 3,// The minimum of chars to go on the new line
"compound": "all", /... | [
"function",
"prepareConfig",
"(",
"sLanguage",
",",
"oConfig",
")",
"{",
"//Creating default configuration",
"var",
"oConfigurationForLanguage",
"=",
"{",
"\"require\"",
":",
"[",
"sLanguage",
"]",
",",
"\"hyphen\"",
":",
"\"\\u00AD\"",
",",
"\"leftmin\"",
":",
"3",... | Transforms the given config so it can be sent to Hyphenopoly.
@param {string} sLanguage The language for which a config is prepared.
@param {map} oConfig Object map with configuration
@returns {Object} {{require: [*], hyphen: string, path: (string|*)}}
@private | [
"Transforms",
"the",
"given",
"config",
"so",
"it",
"can",
"be",
"sent",
"to",
"Hyphenopoly",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/hyphenation/Hyphenation.js#L192-L233 | train | Creates the configuration for the given language. | [
30522,
3853,
7374,
8663,
8873,
2290,
1006,
21435,
6692,
3351,
1010,
1051,
8663,
8873,
2290,
1007,
1063,
1013,
1013,
4526,
12398,
9563,
13075,
1051,
8663,
8873,
27390,
3370,
29278,
25023,
6692,
3351,
1027,
1063,
1000,
5478,
1000,
1024,
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... |
benweet/stackedit | src/libs/pagedown.js | TextareaState | function TextareaState(input) {
// Aliases
var stateObj = this;
var inputArea = input;
this.init = function () {
this.setInputAreaSelectionStartEnd();
this.text = inputArea.getContent();
};
// Sets the selected text in the input box after we've performed an
// operation.
this.setInputAreaSelec... | javascript | function TextareaState(input) {
// Aliases
var stateObj = this;
var inputArea = input;
this.init = function () {
this.setInputAreaSelectionStartEnd();
this.text = inputArea.getContent();
};
// Sets the selected text in the input box after we've performed an
// operation.
this.setInputAreaSelec... | [
"function",
"TextareaState",
"(",
"input",
")",
"{",
"// Aliases",
"var",
"stateObj",
"=",
"this",
";",
"var",
"inputArea",
"=",
"input",
";",
"this",
".",
"init",
"=",
"function",
"(",
")",
"{",
"this",
".",
"setInputAreaSelectionStartEnd",
"(",
")",
";",... | The input textarea state/contents. This is used to implement undo/redo by the undo manager. | [
"The",
"input",
"textarea",
"state",
"/",
"contents",
".",
"This",
"is",
"used",
"to",
"implement",
"undo",
"/",
"redo",
"by",
"the",
"undo",
"manager",
"."
] | 91f8cf3c10b75df65b69f9181cee8151d65a788d | https://github.com/benweet/stackedit/blob/91f8cf3c10b75df65b69f9181cee8151d65a788d/src/libs/pagedown.js#L327-L388 | train | TextareaState constructor. | [
30522,
3853,
3793,
12069,
14083,
3686,
1006,
7953,
1007,
1063,
1013,
1013,
14593,
2229,
13075,
2110,
16429,
3501,
1027,
2023,
1025,
13075,
7953,
12069,
2050,
1027,
7953,
1025,
2023,
1012,
1999,
4183,
1027,
3853,
1006,
1007,
1063,
2023,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/search/FileFilters.js | filterPath | function filterPath(compiledFilter, fullPath) {
if (!compiledFilter) {
return true;
}
var re = new RegExp(compiledFilter);
return !fullPath.match(re);
} | javascript | function filterPath(compiledFilter, fullPath) {
if (!compiledFilter) {
return true;
}
var re = new RegExp(compiledFilter);
return !fullPath.match(re);
} | [
"function",
"filterPath",
"(",
"compiledFilter",
",",
"fullPath",
")",
"{",
"if",
"(",
"!",
"compiledFilter",
")",
"{",
"return",
"true",
";",
"}",
"var",
"re",
"=",
"new",
"RegExp",
"(",
"compiledFilter",
")",
";",
"return",
"!",
"fullPath",
".",
"match... | Returns false if the given path matches any of the exclusion globs in the given filter. Returns true
if the path does not match any of the globs. If filtering many paths at once, use filterFileList()
for much better performance.
@param {?string} compiledFilter 'Compiled' filter object as returned by compile(), or nul... | [
"Returns",
"false",
"if",
"the",
"given",
"path",
"matches",
"any",
"of",
"the",
"exclusion",
"globs",
"in",
"the",
"given",
"filter",
".",
"Returns",
"true",
"if",
"the",
"path",
"does",
"not",
"match",
"any",
"of",
"the",
"globs",
".",
"If",
"filtering... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FileFilters.js#L269-L276 | train | filter the path based on the filter | [
30522,
3853,
11307,
15069,
1006,
9227,
8873,
21928,
1010,
2440,
15069,
1007,
1063,
2065,
1006,
999,
9227,
8873,
21928,
1007,
1063,
2709,
2995,
1025,
1065,
13075,
2128,
1027,
2047,
19723,
10288,
2361,
1006,
9227,
8873,
21928,
1007,
1025,
270... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
LLK/scratch-blocks | blocks_vertical/motion.js | function() {
this.jsonInit({
"message0": Blockly.Msg.MOTION_SETROTATIONSTYLE,
"args0": [
{
"type": "field_dropdown",
"name": "STYLE",
"options": [
[Blockly.Msg.MOTION_SETROTATIONSTYLE_LEFTRIGHT, 'left-right'],
[Blockly.Msg.MOTION_SETROTATIONS... | javascript | function() {
this.jsonInit({
"message0": Blockly.Msg.MOTION_SETROTATIONSTYLE,
"args0": [
{
"type": "field_dropdown",
"name": "STYLE",
"options": [
[Blockly.Msg.MOTION_SETROTATIONSTYLE_LEFTRIGHT, 'left-right'],
[Blockly.Msg.MOTION_SETROTATIONS... | [
"function",
"(",
")",
"{",
"this",
".",
"jsonInit",
"(",
"{",
"\"message0\"",
":",
"Blockly",
".",
"Msg",
".",
"MOTION_SETROTATIONSTYLE",
",",
"\"args0\"",
":",
"[",
"{",
"\"type\"",
":",
"\"field_dropdown\"",
",",
"\"name\"",
":",
"\"STYLE\"",
",",
"\"optio... | Block to set rotation style.
@this Blockly.Block | [
"Block",
"to",
"set",
"rotation",
"style",
"."
] | 455b2a854435c0a67da1da92320ddc3ec3e2b799 | https://github.com/LLK/scratch-blocks/blob/455b2a854435c0a67da1da92320ddc3ec3e2b799/blocks_vertical/motion.js#L416-L433 | train | Block for the set rotation style. | [
30522,
3853,
1006,
1007,
1063,
2023,
1012,
1046,
3385,
5498,
2102,
1006,
1063,
1000,
4471,
2692,
1000,
1024,
3796,
2135,
1012,
5796,
2290,
1012,
4367,
1035,
2275,
21709,
10708,
27983,
1010,
1000,
12098,
5620,
2692,
1000,
1024,
1031,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
cytoscape/cytoscape.js | dist/cytoscape.esm.js | renderedPosition | function renderedPosition(dim, val) {
var ele = this[0];
var cy = this.cy();
var zoom = cy.zoom();
var pan = cy.pan();
var rpos = plainObject(dim) ? dim : undefined;
var setting = rpos !== undefined || val !== undefined && string(dim);
if (ele && ele.isNode()) {
// must have an elemen... | javascript | function renderedPosition(dim, val) {
var ele = this[0];
var cy = this.cy();
var zoom = cy.zoom();
var pan = cy.pan();
var rpos = plainObject(dim) ? dim : undefined;
var setting = rpos !== undefined || val !== undefined && string(dim);
if (ele && ele.isNode()) {
// must have an elemen... | [
"function",
"renderedPosition",
"(",
"dim",
",",
"val",
")",
"{",
"var",
"ele",
"=",
"this",
"[",
"0",
"]",
";",
"var",
"cy",
"=",
"this",
".",
"cy",
"(",
")",
";",
"var",
"zoom",
"=",
"cy",
".",
"zoom",
"(",
")",
";",
"var",
"pan",
"=",
"cy"... | get/set the rendered (i.e. on screen) positon of the element | [
"get",
"/",
"set",
"the",
"rendered",
"(",
"i",
".",
"e",
".",
"on",
"screen",
")",
"positon",
"of",
"the",
"element"
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L8340-L8380 | train | Returns the rendered position of an element in the specified dimension. | [
30522,
3853,
10155,
26994,
1006,
11737,
1010,
11748,
1007,
1063,
13075,
3449,
2063,
1027,
2023,
1031,
1014,
1033,
1025,
13075,
22330,
1027,
2023,
1012,
22330,
1006,
1007,
1025,
13075,
24095,
1027,
22330,
1012,
24095,
1006,
1007,
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... |
feathericons/feather | bin/process-svg.js | optimize | function optimize(svg) {
const svgo = new Svgo({
plugins: [
{ convertShapeToPath: false },
{ mergePaths: false },
{ removeAttrs: { attrs: '(fill|stroke.*)' } },
{ removeTitle: true },
],
});
return new Promise(resolve => {
svgo.optimize(svg, ({ data }) => resolve(data));
});... | javascript | function optimize(svg) {
const svgo = new Svgo({
plugins: [
{ convertShapeToPath: false },
{ mergePaths: false },
{ removeAttrs: { attrs: '(fill|stroke.*)' } },
{ removeTitle: true },
],
});
return new Promise(resolve => {
svgo.optimize(svg, ({ data }) => resolve(data));
});... | [
"function",
"optimize",
"(",
"svg",
")",
"{",
"const",
"svgo",
"=",
"new",
"Svgo",
"(",
"{",
"plugins",
":",
"[",
"{",
"convertShapeToPath",
":",
"false",
"}",
",",
"{",
"mergePaths",
":",
"false",
"}",
",",
"{",
"removeAttrs",
":",
"{",
"attrs",
":"... | Optimize SVG with `svgo`.
@param {string} svg - An SVG string.
@returns {Promise<string>} | [
"Optimize",
"SVG",
"with",
"svgo",
"."
] | 8f658193d25e943b196a2367319b5d9e85ee9f9f | https://github.com/feathericons/feather/blob/8f658193d25e943b196a2367319b5d9e85ee9f9f/bin/process-svg.js#L28-L41 | train | optimize the given SVG | [
30522,
3853,
23569,
27605,
4371,
1006,
17917,
2290,
1007,
1063,
9530,
3367,
17917,
3995,
1027,
2047,
17917,
3995,
1006,
1063,
13354,
7076,
1024,
1031,
1063,
19884,
3270,
22327,
29477,
2705,
1024,
6270,
1065,
1010,
1063,
13590,
15069,
2015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/project/FileTreeView.js | function () {
if (!this.props.entry.get("rename")) {
if (this.state.clickTimer !== null) {
this.clearTimer();
}
this.props.actions.selectInWorkingSet(this.myPath());
}
} | javascript | function () {
if (!this.props.entry.get("rename")) {
if (this.state.clickTimer !== null) {
this.clearTimer();
}
this.props.actions.selectInWorkingSet(this.myPath());
}
} | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"props",
".",
"entry",
".",
"get",
"(",
"\"rename\"",
")",
")",
"{",
"if",
"(",
"this",
".",
"state",
".",
"clickTimer",
"!==",
"null",
")",
"{",
"this",
".",
"clearTimer",
"(",
")",
";",
... | When the user double clicks, we will select this file and add it to the working
set (via the `selectInWorkingSet` action.) | [
"When",
"the",
"user",
"double",
"clicks",
"we",
"will",
"select",
"this",
"file",
"and",
"add",
"it",
"to",
"the",
"working",
"set",
"(",
"via",
"the",
"selectInWorkingSet",
"action",
".",
")"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L567-L574 | train | select the file in the working set | [
30522,
3853,
1006,
1007,
1063,
2065,
1006,
999,
2023,
1012,
24387,
1012,
4443,
1012,
2131,
1006,
1000,
14916,
14074,
1000,
1007,
1007,
1063,
2065,
1006,
2023,
1012,
2110,
1012,
11562,
7292,
2099,
999,
1027,
1027,
19701,
1007,
1063,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
NervJS/taro | packages/taro-rn-runner/src/index.js | printServerInfo | async function printServerInfo () {
await ProjectSettings.readPackagerInfoAsync(projectDir)
// who knows why qrcode-terminal takes a callback instead of just returning a string
const address = await UrlUtils.constructManifestUrlAsync(projectDir)
let emulatorHelp
if (process.platform === 'darwin') {
emulat... | javascript | async function printServerInfo () {
await ProjectSettings.readPackagerInfoAsync(projectDir)
// who knows why qrcode-terminal takes a callback instead of just returning a string
const address = await UrlUtils.constructManifestUrlAsync(projectDir)
let emulatorHelp
if (process.platform === 'darwin') {
emulat... | [
"async",
"function",
"printServerInfo",
"(",
")",
"{",
"await",
"ProjectSettings",
".",
"readPackagerInfoAsync",
"(",
"projectDir",
")",
"// who knows why qrcode-terminal takes a callback instead of just returning a string",
"const",
"address",
"=",
"await",
"UrlUtils",
".",
... | print a nicely formatted message with setup information | [
"print",
"a",
"nicely",
"formatted",
"message",
"with",
"setup",
"information"
] | 274e76d731d7f158141287e31cbd51f092d472c5 | https://github.com/NervJS/taro/blob/274e76d731d7f158141287e31cbd51f092d472c5/packages/taro-rn-runner/src/index.js#L58-L86 | train | Print server info | [
30522,
2004,
6038,
2278,
3853,
11204,
2121,
6299,
2378,
14876,
1006,
1007,
1063,
26751,
3934,
18319,
3070,
2015,
1012,
3191,
23947,
17325,
2378,
14876,
3022,
6038,
2278,
1006,
2622,
4305,
2099,
1007,
1013,
1013,
2040,
4282,
2339,
1053,
2956... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Control.js | fnAppendBusyIndicator | function fnAppendBusyIndicator() {
// Only append if busy state is still set
if (!this.getBusy()) {
return;
}
var $this = this.$(this._sBusySection);
//If there is a pending delayed call to append the busy indicator, we can clear it now
if (this._busyIndicatorDelayedCallId) {
clearTimeout(this._bus... | javascript | function fnAppendBusyIndicator() {
// Only append if busy state is still set
if (!this.getBusy()) {
return;
}
var $this = this.$(this._sBusySection);
//If there is a pending delayed call to append the busy indicator, we can clear it now
if (this._busyIndicatorDelayedCallId) {
clearTimeout(this._bus... | [
"function",
"fnAppendBusyIndicator",
"(",
")",
"{",
"// Only append if busy state is still set",
"if",
"(",
"!",
"this",
".",
"getBusy",
"(",
")",
")",
"{",
"return",
";",
"}",
"var",
"$this",
"=",
"this",
".",
"$",
"(",
"this",
".",
"_sBusySection",
")",
... | Add busy indicator to DOM
@private | [
"Add",
"busy",
"indicator",
"to",
"DOM"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Control.js#L721-L759 | train | Append busy indicator to the DOM | [
30522,
3853,
1042,
2532,
21512,
4859,
8286,
25811,
14808,
8844,
1006,
1007,
1063,
1013,
1013,
2069,
10439,
10497,
2065,
5697,
2110,
2003,
2145,
2275,
2065,
1006,
999,
2023,
1012,
2131,
8286,
2100,
1006,
1007,
1007,
1063,
2709,
1025,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cytoscape/cytoscape.js | dist/cytoscape.esm.js | closenessCentrality | function closenessCentrality(options) {
var _defaults2 = defaults$2(options),
root = _defaults2.root,
weight = _defaults2.weight,
directed = _defaults2.directed,
harmonic = _defaults2.harmonic;
root = this.filter(root)[0]; // we need distance from this node to every other node
... | javascript | function closenessCentrality(options) {
var _defaults2 = defaults$2(options),
root = _defaults2.root,
weight = _defaults2.weight,
directed = _defaults2.directed,
harmonic = _defaults2.harmonic;
root = this.filter(root)[0]; // we need distance from this node to every other node
... | [
"function",
"closenessCentrality",
"(",
"options",
")",
"{",
"var",
"_defaults2",
"=",
"defaults$2",
"(",
"options",
")",
",",
"root",
"=",
"_defaults2",
".",
"root",
",",
"weight",
"=",
"_defaults2",
".",
"weight",
",",
"directed",
"=",
"_defaults2",
".",
... | Implemented from pseudocode from wikipedia | [
"Implemented",
"from",
"pseudocode",
"from",
"wikipedia"
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L3568-L3600 | train | Returns the closeness centrality of the cluster | [
30522,
3853,
28398,
13013,
7941,
3012,
1006,
7047,
1007,
1063,
13075,
1035,
12398,
2015,
2475,
1027,
12398,
2015,
1002,
1016,
1006,
7047,
1007,
1010,
7117,
1027,
1035,
12398,
2015,
2475,
1012,
7117,
1010,
3635,
1027,
1035,
12398,
2015,
2475... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/websocket.js | receiverOnError | function receiverOnError(err) {
const websocket = this[kWebSocket];
websocket._socket.removeListener('data', socketOnData);
websocket.readyState = WebSocket.CLOSING;
websocket._closeCode = err[kStatusCode];
websocket.emit('error', err);
websocket._socket.destroy();
} | javascript | function receiverOnError(err) {
const websocket = this[kWebSocket];
websocket._socket.removeListener('data', socketOnData);
websocket.readyState = WebSocket.CLOSING;
websocket._closeCode = err[kStatusCode];
websocket.emit('error', err);
websocket._socket.destroy();
} | [
"function",
"receiverOnError",
"(",
"err",
")",
"{",
"const",
"websocket",
"=",
"this",
"[",
"kWebSocket",
"]",
";",
"websocket",
".",
"_socket",
".",
"removeListener",
"(",
"'data'",
",",
"socketOnData",
")",
";",
"websocket",
".",
"readyState",
"=",
"WebSo... | The listener of the `Receiver` `'error'` event.
@param {(RangeError|Error)} err The emitted error
@private | [
"The",
"listener",
"of",
"the",
"Receiver",
"error",
"event",
"."
] | 995c527c87d0d4833d8093c18dcfa2e4a41d9582 | https://github.com/websockets/ws/blob/995c527c87d0d4833d8093c18dcfa2e4a41d9582/lib/websocket.js#L769-L778 | train | receiverOnError - Error handler | [
30522,
3853,
8393,
5643,
18933,
2099,
1006,
9413,
2099,
1007,
1063,
9530,
3367,
4773,
6499,
19869,
2102,
1027,
2023,
1031,
6448,
15878,
6499,
19869,
2102,
1033,
1025,
4773,
6499,
19869,
2102,
1012,
1035,
22278,
1012,
6366,
9863,
24454,
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... |
getinsomnia/insomnia | packages/insomnia-importers/src/importers/openapi3.js | parseEndpoints | function parseEndpoints(document) {
const defaultParent = WORKSPACE_ID;
const paths = Object.keys(document.paths);
const endpointsSchemas = paths
.map(path => {
const schemasPerMethod = document.paths[path];
const methods = Object.keys(schemasPerMethod);
return methods
.filter(meth... | javascript | function parseEndpoints(document) {
const defaultParent = WORKSPACE_ID;
const paths = Object.keys(document.paths);
const endpointsSchemas = paths
.map(path => {
const schemasPerMethod = document.paths[path];
const methods = Object.keys(schemasPerMethod);
return methods
.filter(meth... | [
"function",
"parseEndpoints",
"(",
"document",
")",
"{",
"const",
"defaultParent",
"=",
"WORKSPACE_ID",
";",
"const",
"paths",
"=",
"Object",
".",
"keys",
"(",
"document",
".",
"paths",
")",
";",
"const",
"endpointsSchemas",
"=",
"paths",
".",
"map",
"(",
... | Create request definitions based on openapi document.
@param {Object} document - OpenAPI 3 valid object (https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#oasObject)
@returns {Object[]} array of insomnia endpoints definitions | [
"Create",
"request",
"definitions",
"based",
"on",
"openapi",
"document",
"."
] | e24ce7f7b41246e700c4b9bdb6b34b6652ad589b | https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-importers/src/importers/openapi3.js#L98-L134 | train | Parse a document of endpoints | [
30522,
3853,
11968,
19763,
4859,
26521,
1006,
6254,
1007,
1063,
9530,
3367,
12398,
19362,
4765,
1027,
2573,
15327,
1035,
8909,
1025,
9530,
3367,
10425,
1027,
4874,
1012,
6309,
1006,
6254,
1012,
10425,
1007,
1025,
9530,
3367,
2203,
26521,
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... |
adobe/brackets | src/JSUtils/ScopeManager.js | handleTernCompletions | function handleTernCompletions(response) {
var file = response.file,
offset = response.offset,
completions = response.completions,
properties = response.properties,
fnType = response.fnType,
type = response.type,
error = response.error,
... | javascript | function handleTernCompletions(response) {
var file = response.file,
offset = response.offset,
completions = response.completions,
properties = response.properties,
fnType = response.fnType,
type = response.type,
error = response.error,
... | [
"function",
"handleTernCompletions",
"(",
"response",
")",
"{",
"var",
"file",
"=",
"response",
".",
"file",
",",
"offset",
"=",
"response",
".",
"offset",
",",
"completions",
"=",
"response",
".",
"completions",
",",
"properties",
"=",
"response",
".",
"pro... | Handle the response from the tern node domain when
it responds with the list of completions
@param {{file: string, offset: {line: number, ch: number}, completions:Array.<string>,
properties:Array.<string>}} response - the response from node domain | [
"Handle",
"the",
"response",
"from",
"the",
"tern",
"node",
"domain",
"when",
"it",
"responds",
"with",
"the",
"list",
"of",
"completions"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L690-L712 | train | Handle Tern completions | [
30522,
3853,
5047,
16451,
9006,
10814,
9285,
1006,
3433,
1007,
1063,
13075,
5371,
1027,
3433,
1012,
5371,
1010,
16396,
1027,
3433,
1012,
16396,
1010,
6503,
2015,
1027,
3433,
1012,
6503,
2015,
1010,
5144,
1027,
3433,
1012,
5144,
1010,
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... |
nhn/tui.editor | src/js/markdownItPlugins/markdownitTaskPlugin.js | isChecked | function isChecked(token) {
var checked = false;
if (token.content.indexOf('[x]') === 0 || token.content.indexOf('[X]') === 0) {
checked = true;
}
return checked;
} | javascript | function isChecked(token) {
var checked = false;
if (token.content.indexOf('[x]') === 0 || token.content.indexOf('[X]') === 0) {
checked = true;
}
return checked;
} | [
"function",
"isChecked",
"(",
"token",
")",
"{",
"var",
"checked",
"=",
"false",
";",
"if",
"(",
"token",
".",
"content",
".",
"indexOf",
"(",
"'[x]'",
")",
"===",
"0",
"||",
"token",
".",
"content",
".",
"indexOf",
"(",
"'[X]'",
")",
"===",
"0",
"... | Return boolean value whether task checked or not
@param {object} token Token object
@returns {boolean}
@ignore | [
"Return",
"boolean",
"value",
"whether",
"task",
"checked",
"or",
"not"
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/markdownItPlugins/markdownitTaskPlugin.js#L60-L68 | train | Check if the given token is checked | [
30522,
3853,
2003,
5403,
18141,
1006,
19204,
1007,
1063,
13075,
7039,
1027,
6270,
1025,
2065,
1006,
19204,
1012,
4180,
1012,
5950,
11253,
1006,
1005,
1031,
1060,
1033,
1005,
1007,
1027,
1027,
1027,
1014,
1064,
1064,
19204,
1012,
4180,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/QuickOpenHTML/main.js | createIDList | function createIDList() {
var doc = DocumentManager.getCurrentDocument();
if (!doc) {
return;
}
var idList = [];
var docText = doc.getText();
var lines = docText.split("\n");
var regex = new RegExp(/\s+id\s*?=\s*?["'](.*?)["']/gi);
var id, ch... | javascript | function createIDList() {
var doc = DocumentManager.getCurrentDocument();
if (!doc) {
return;
}
var idList = [];
var docText = doc.getText();
var lines = docText.split("\n");
var regex = new RegExp(/\s+id\s*?=\s*?["'](.*?)["']/gi);
var id, ch... | [
"function",
"createIDList",
"(",
")",
"{",
"var",
"doc",
"=",
"DocumentManager",
".",
"getCurrentDocument",
"(",
")",
";",
"if",
"(",
"!",
"doc",
")",
"{",
"return",
";",
"}",
"var",
"idList",
"=",
"[",
"]",
";",
"var",
"docText",
"=",
"doc",
".",
... | Returns a list of information about ID's for a single document. This array is populated
by createIDList()
@type {?Array.<FileLocation>} | [
"Returns",
"a",
"list",
"of",
"information",
"about",
"ID",
"s",
"for",
"a",
"single",
"document",
".",
"This",
"array",
"is",
"populated",
"by",
"createIDList",
"()"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/QuickOpenHTML/main.js#L58-L84 | train | Create an array of FileLocations | [
30522,
3853,
3443,
3593,
9863,
1006,
1007,
1063,
13075,
9986,
1027,
6254,
24805,
4590,
1012,
2131,
10841,
14343,
3372,
3527,
24894,
4765,
1006,
1007,
1025,
2065,
1006,
999,
9986,
1007,
1063,
2709,
1025,
1065,
13075,
8909,
9863,
1027,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
BlackrockDigital/startbootstrap-sb-admin-2 | vendor/chart.js/Chart.js | function() {
var me = this;
if (core_plugins.notify(me, 'beforeLayout') === false) {
return;
}
core_layouts.update(this, this.width, this.height);
/**
* Provided for backward compatibility, use `afterLayout` instead.
* @method IPlugin#afterScaleUpdate
* @deprecated since version 2.5.0
* @tod... | javascript | function() {
var me = this;
if (core_plugins.notify(me, 'beforeLayout') === false) {
return;
}
core_layouts.update(this, this.width, this.height);
/**
* Provided for backward compatibility, use `afterLayout` instead.
* @method IPlugin#afterScaleUpdate
* @deprecated since version 2.5.0
* @tod... | [
"function",
"(",
")",
"{",
"var",
"me",
"=",
"this",
";",
"if",
"(",
"core_plugins",
".",
"notify",
"(",
"me",
",",
"'beforeLayout'",
")",
"===",
"false",
")",
"{",
"return",
";",
"}",
"core_layouts",
".",
"update",
"(",
"this",
",",
"this",
".",
"... | Updates the chart layout unless a plugin returns `false` to the `beforeLayout`
hook, in which case, plugins will not be called on `afterLayout`.
@private | [
"Updates",
"the",
"chart",
"layout",
"unless",
"a",
"plugin",
"returns",
"false",
"to",
"the",
"beforeLayout",
"hook",
"in",
"which",
"case",
"plugins",
"will",
"not",
"be",
"called",
"on",
"afterLayout",
"."
] | ddfaceb4a8e65a41f163e2fdc4eab49384b810a1 | https://github.com/BlackrockDigital/startbootstrap-sb-admin-2/blob/ddfaceb4a8e65a41f163e2fdc4eab49384b810a1/vendor/chart.js/Chart.js#L8771-L8789 | train | Updates the layout of the image. | [
30522,
3853,
1006,
1007,
1063,
13075,
2033,
1027,
2023,
1025,
2065,
1006,
4563,
1035,
13354,
7076,
1012,
2025,
8757,
1006,
2033,
1010,
1005,
2077,
8485,
5833,
1005,
1007,
1027,
1027,
1027,
6270,
1007,
1063,
2709,
1025,
1065,
4563,
1035,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
NetEase/pomelo | lib/util/appUtil.js | function(args) {
var argsMap = {};
var mainPos = 1;
while (args[mainPos].indexOf('--') > 0) {
mainPos++;
}
argsMap.main = args[mainPos];
for (var i = (mainPos + 1); i < args.length; i++) {
var arg = args[i];
var sep = arg.indexOf('=');
var key = arg.slice(0, sep);
var value = arg.slice... | javascript | function(args) {
var argsMap = {};
var mainPos = 1;
while (args[mainPos].indexOf('--') > 0) {
mainPos++;
}
argsMap.main = args[mainPos];
for (var i = (mainPos + 1); i < args.length; i++) {
var arg = args[i];
var sep = arg.indexOf('=');
var key = arg.slice(0, sep);
var value = arg.slice... | [
"function",
"(",
"args",
")",
"{",
"var",
"argsMap",
"=",
"{",
"}",
";",
"var",
"mainPos",
"=",
"1",
";",
"while",
"(",
"args",
"[",
"mainPos",
"]",
".",
"indexOf",
"(",
"'--'",
")",
">",
"0",
")",
"{",
"mainPos",
"++",
";",
"}",
"argsMap",
"."... | Parse command line arguments.
@param args command line arguments
@return Object argsMap map of arguments | [
"Parse",
"command",
"line",
"arguments",
"."
] | defcf019631ed399cc4dad932d3b028a04a039a4 | https://github.com/NetEase/pomelo/blob/defcf019631ed399cc4dad932d3b028a04a039a4/lib/util/appUtil.js#L222-L243 | train | Get argsMap from args | [
30522,
3853,
1006,
12098,
5620,
1007,
1063,
13075,
12098,
5620,
2863,
2361,
1027,
1063,
1065,
1025,
13075,
2364,
6873,
2015,
1027,
1015,
1025,
2096,
1006,
12098,
5620,
1031,
2364,
6873,
2015,
1033,
1012,
5950,
11253,
1006,
1005,
1011,
1011,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/LiveDevelopment/main.js | _setupDebugHelpers | function _setupDebugHelpers() {
window.ld = LiveDevelopment;
window.i = Inspector;
window.report = function report(params) { window.params = params; console.info(params); };
} | javascript | function _setupDebugHelpers() {
window.ld = LiveDevelopment;
window.i = Inspector;
window.report = function report(params) { window.params = params; console.info(params); };
} | [
"function",
"_setupDebugHelpers",
"(",
")",
"{",
"window",
".",
"ld",
"=",
"LiveDevelopment",
";",
"window",
".",
"i",
"=",
"Inspector",
";",
"window",
".",
"report",
"=",
"function",
"report",
"(",
"params",
")",
"{",
"window",
".",
"params",
"=",
"para... | Setup window references to useful LiveDevelopment modules | [
"Setup",
"window",
"references",
"to",
"useful",
"LiveDevelopment",
"modules"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/main.js#L314-L318 | train | Setup debug helpers | [
30522,
3853,
1035,
16437,
3207,
8569,
5603,
2884,
7347,
1006,
1007,
1063,
3332,
1012,
25510,
1027,
2973,
18697,
4135,
24073,
1025,
3332,
1012,
1045,
1027,
7742,
1025,
3332,
1012,
3189,
1027,
3853,
3189,
1006,
11498,
5244,
1007,
1063,
3332,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/RequestRecorder.js | function(url, response, method, status, headers) {
if (!_private.isPlayStarted()) {
throw new Error("Start the player first before you add a response.");
}
var sMethod = method || "GET";
var aHeaders = headers || [{
"name": "Content-Type",
"value": "text/plain;charset=utf-8"
}];
var iStatu... | javascript | function(url, response, method, status, headers) {
if (!_private.isPlayStarted()) {
throw new Error("Start the player first before you add a response.");
}
var sMethod = method || "GET";
var aHeaders = headers || [{
"name": "Content-Type",
"value": "text/plain;charset=utf-8"
}];
var iStatu... | [
"function",
"(",
"url",
",",
"response",
",",
"method",
",",
"status",
",",
"headers",
")",
"{",
"if",
"(",
"!",
"_private",
".",
"isPlayStarted",
"(",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Start the player first before you add a response.\"",
")",
... | Adds a response for a request with the provided URL.
@param {string} url The requested URL.
@param {string|function} response The returned response as string or callback.
@param {string} [method] The HTTP method (e.g. GET, POST), default is GET.
@param {int} [status] The desired status, default is 200.
@param {array} ... | [
"Adds",
"a",
"response",
"for",
"a",
"request",
"with",
"the",
"provided",
"URL",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/RequestRecorder.js#L806-L834 | train | Add a response to the log file | [
30522,
3853,
1006,
24471,
2140,
1010,
3433,
1010,
4118,
1010,
3570,
1010,
20346,
2015,
1007,
1063,
2065,
1006,
999,
1035,
2797,
1012,
2003,
13068,
14117,
3064,
1006,
1007,
1007,
1063,
5466,
2047,
7561,
1006,
1000,
2707,
1996,
2447,
2034,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
chartjs/Chart.js | src/helpers/helpers.core.js | function(loopable, fn, thisArg, reverse) {
var i, len, keys;
if (helpers.isArray(loopable)) {
len = loopable.length;
if (reverse) {
for (i = len - 1; i >= 0; i--) {
fn.call(thisArg, loopable[i], i);
}
} else {
for (i = 0; i < len; i++) {
fn.call(thisArg, loopable[i], i);
}
}
... | javascript | function(loopable, fn, thisArg, reverse) {
var i, len, keys;
if (helpers.isArray(loopable)) {
len = loopable.length;
if (reverse) {
for (i = len - 1; i >= 0; i--) {
fn.call(thisArg, loopable[i], i);
}
} else {
for (i = 0; i < len; i++) {
fn.call(thisArg, loopable[i], i);
}
}
... | [
"function",
"(",
"loopable",
",",
"fn",
",",
"thisArg",
",",
"reverse",
")",
"{",
"var",
"i",
",",
"len",
",",
"keys",
";",
"if",
"(",
"helpers",
".",
"isArray",
"(",
"loopable",
")",
")",
"{",
"len",
"=",
"loopable",
".",
"length",
";",
"if",
"(... | Note(SB) for performance sake, this method should only be used when loopable type
is unknown or in none intensive code (not called often and small loopable). Else
it's preferable to use a regular for() loop and save extra function calls.
@param {object|Array} loopable - The object or array to be iterated.
@param {funct... | [
"Note",
"(",
"SB",
")",
"for",
"performance",
"sake",
"this",
"method",
"should",
"only",
"be",
"used",
"when",
"loopable",
"type",
"is",
"unknown",
"or",
"in",
"none",
"intensive",
"code",
"(",
"not",
"called",
"often",
"and",
"small",
"loopable",
")",
... | f093c36574d290330ed623e60fbd070421c730d5 | https://github.com/chartjs/Chart.js/blob/f093c36574d290330ed623e60fbd070421c730d5/src/helpers/helpers.core.js#L114-L134 | train | This function is used to call a function on an object or array. | [
30522,
3853,
1006,
7077,
3085,
1010,
1042,
2078,
1010,
2023,
2906,
2290,
1010,
7901,
1007,
1063,
13075,
1045,
1010,
18798,
1010,
6309,
1025,
2065,
1006,
2393,
2545,
1012,
18061,
11335,
2100,
1006,
7077,
3085,
1007,
1007,
1063,
18798,
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... | |
apache/incubator-echarts | src/echarts.js | prepareView | function prepareView(ecIns, type, ecModel, scheduler) {
var isComponent = type === 'component';
var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews;
var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap;
var zr = ecIns._zr;
var api = ecIns._api;
for (var i = 0... | javascript | function prepareView(ecIns, type, ecModel, scheduler) {
var isComponent = type === 'component';
var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews;
var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap;
var zr = ecIns._zr;
var api = ecIns._api;
for (var i = 0... | [
"function",
"prepareView",
"(",
"ecIns",
",",
"type",
",",
"ecModel",
",",
"scheduler",
")",
"{",
"var",
"isComponent",
"=",
"type",
"===",
"'component'",
";",
"var",
"viewList",
"=",
"isComponent",
"?",
"ecIns",
".",
"_componentsViews",
":",
"ecIns",
".",
... | Prepare view instances of charts and components
@param {module:echarts/model/Global} ecModel
@private | [
"Prepare",
"view",
"instances",
"of",
"charts",
"and",
"components"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/echarts.js#L1352-L1414 | train | prepare view for ecModel | [
30522,
3853,
7374,
8584,
1006,
14925,
7076,
1010,
2828,
1010,
14925,
5302,
9247,
1010,
6134,
2099,
1007,
1063,
13075,
2003,
9006,
29513,
3372,
1027,
2828,
1027,
1027,
1027,
1005,
6922,
1005,
1025,
13075,
30524,
1035,
6177,
2863,
2361,
1024,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/XMLTemplateProcessor.js | asyncStrategy | function asyncStrategy(node, oAggregation, mAggregations) {
var childNode,
pChain = Promise.resolve(),
aChildPromises = [];
for (childNode = node.firstChild; childNode; childNode = childNode.nextSibling) {
pChain = pChain.then(fnCallback.bind(null, node, oAggregation, mAggregations, childNode));
... | javascript | function asyncStrategy(node, oAggregation, mAggregations) {
var childNode,
pChain = Promise.resolve(),
aChildPromises = [];
for (childNode = node.firstChild; childNode; childNode = childNode.nextSibling) {
pChain = pChain.then(fnCallback.bind(null, node, oAggregation, mAggregations, childNode));
... | [
"function",
"asyncStrategy",
"(",
"node",
",",
"oAggregation",
",",
"mAggregations",
")",
"{",
"var",
"childNode",
",",
"pChain",
"=",
"Promise",
".",
"resolve",
"(",
")",
",",
"aChildPromises",
"=",
"[",
"]",
";",
"for",
"(",
"childNode",
"=",
"node",
"... | async strategy ensures processing order by chaining the callbacks | [
"async",
"strategy",
"ensures",
"processing",
"order",
"by",
"chaining",
"the",
"callbacks"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/XMLTemplateProcessor.js#L116-L126 | train | async strategy for async aggregation | [
30522,
3853,
2004,
6038,
6169,
6494,
2618,
6292,
1006,
13045,
1010,
1051,
8490,
17603,
12540,
1010,
23848,
17603,
12540,
2015,
1007,
1063,
13075,
2775,
3630,
3207,
1010,
7473,
10932,
2078,
1027,
4872,
1012,
10663,
1006,
1007,
1010,
9353,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
facebook/flow | packages/flow-remove-types/index.js | isLastNodeRemovedFromLine | function isLastNodeRemovedFromLine(context, node) {
var tokens = context.ast.tokens;
var priorTokenIdx = findTokenIndex(tokens, startOf(node)) - 1;
var token = tokens[priorTokenIdx];
var line = node.loc.end.line;
// Find previous token that was not removed on the same line.
while (
priorTokenIdx >= 0 &... | javascript | function isLastNodeRemovedFromLine(context, node) {
var tokens = context.ast.tokens;
var priorTokenIdx = findTokenIndex(tokens, startOf(node)) - 1;
var token = tokens[priorTokenIdx];
var line = node.loc.end.line;
// Find previous token that was not removed on the same line.
while (
priorTokenIdx >= 0 &... | [
"function",
"isLastNodeRemovedFromLine",
"(",
"context",
",",
"node",
")",
"{",
"var",
"tokens",
"=",
"context",
".",
"ast",
".",
"tokens",
";",
"var",
"priorTokenIdx",
"=",
"findTokenIndex",
"(",
"tokens",
",",
"startOf",
"(",
"node",
")",
")",
"-",
"1",
... | Returns true if node is the last to be removed from a line. | [
"Returns",
"true",
"if",
"node",
"is",
"the",
"last",
"to",
"be",
"removed",
"from",
"a",
"line",
"."
] | 25bc6aba258658eaf21ccc4722ef7124724a1d2b | https://github.com/facebook/flow/blob/25bc6aba258658eaf21ccc4722ef7124724a1d2b/packages/flow-remove-types/index.js#L409-L427 | train | Checks if the node is the last node removed from the line. | [
30522,
3853,
25340,
3367,
3630,
4063,
6633,
21818,
20952,
21716,
4179,
1006,
6123,
1010,
13045,
1007,
1063,
13075,
19204,
2015,
1027,
6123,
1012,
2004,
2102,
1012,
19204,
2015,
1025,
13075,
3188,
18715,
18595,
2094,
2595,
1027,
2424,
18715,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/panel/panel.js | definePreset | function definePreset(name, preset) {
if (!name || !preset) {
throw new Error('mdPanelProvider: The panel preset definition is ' +
'malformed. The name and preset object are required.');
} else if (_presets.hasOwnProperty(name)) {
throw new Error('mdPanelProvider: The panel preset you have requested... | javascript | function definePreset(name, preset) {
if (!name || !preset) {
throw new Error('mdPanelProvider: The panel preset definition is ' +
'malformed. The name and preset object are required.');
} else if (_presets.hasOwnProperty(name)) {
throw new Error('mdPanelProvider: The panel preset you have requested... | [
"function",
"definePreset",
"(",
"name",
",",
"preset",
")",
"{",
"if",
"(",
"!",
"name",
"||",
"!",
"preset",
")",
"{",
"throw",
"new",
"Error",
"(",
"'mdPanelProvider: The panel preset definition is '",
"+",
"'malformed. The name and preset object are required.'",
"... | Takes the passed in panel configuration object and adds it to the `_presets`
object at the specified name.
@param {string} name Name of the preset to set.
@param {!Object} preset Specific configuration object that can contain any
and all of the parameters available within the `$mdPanel.create` method.
However, paramete... | [
"Takes",
"the",
"passed",
"in",
"panel",
"configuration",
"object",
"and",
"adds",
"it",
"to",
"the",
"_presets",
"object",
"at",
"the",
"specified",
"name",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/panel/panel.js#L966-L981 | train | Defines a panel preset | [
30522,
3853,
9375,
28994,
3388,
1006,
2171,
1010,
3653,
13462,
1007,
1063,
2065,
1006,
999,
2171,
1064,
1064,
999,
3653,
13462,
1007,
1063,
5466,
2047,
7561,
1006,
1005,
9108,
9739,
2884,
21572,
17258,
2121,
1024,
1996,
5997,
3653,
13462,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/respondable.js | buildErrorObject | function buildErrorObject(error) {
var msg = error.message || 'Unknown error occurred';
var errorName = errorTypes.includes(error.name) ? error.name : 'Error';
var ErrConstructor = window[errorName] || Error;
if (error.stack) {
msg += '\n' + error.stack.replace(error.message, '');
}
return new ErrConstr... | javascript | function buildErrorObject(error) {
var msg = error.message || 'Unknown error occurred';
var errorName = errorTypes.includes(error.name) ? error.name : 'Error';
var ErrConstructor = window[errorName] || Error;
if (error.stack) {
msg += '\n' + error.stack.replace(error.message, '');
}
return new ErrConstr... | [
"function",
"buildErrorObject",
"(",
"error",
")",
"{",
"var",
"msg",
"=",
"error",
".",
"message",
"||",
"'Unknown error occurred'",
";",
"var",
"errorName",
"=",
"errorTypes",
".",
"includes",
"(",
"error",
".",
"name",
")",
"?",
"error",
".",
"name",
":... | Convert a javascript Error into something that can be stringified
@param {Error} error Any type of error
@return {Object} Processable object | [
"Convert",
"a",
"javascript",
"Error",
"into",
"something",
"that",
"can",
"be",
"stringified"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/utils/respondable.js#L166-L175 | train | Build an error object | [
30522,
3853,
12508,
29165,
16429,
20614,
1006,
7561,
1007,
1063,
13075,
5796,
2290,
1027,
7561,
1012,
4471,
1064,
1064,
1005,
4242,
7561,
4158,
1005,
1025,
13075,
7561,
18442,
1027,
7561,
13874,
2015,
1012,
2950,
1006,
7561,
1012,
2171,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
infinitered/ignite | src/cli/enforce-global.js | defaultVersionMatcher | function defaultVersionMatcher(raw) {
// sanity check
if (ramda.isNil(raw) || ramda.isEmpty(raw)) return null
try {
// look for something that looks like semver
var rx = /([0-9]+\.[0-9]+\.[0-9]+)/
var match = ramda.match(rx, raw)
if (match.length > 0) {
return match[0]
} else {
re... | javascript | function defaultVersionMatcher(raw) {
// sanity check
if (ramda.isNil(raw) || ramda.isEmpty(raw)) return null
try {
// look for something that looks like semver
var rx = /([0-9]+\.[0-9]+\.[0-9]+)/
var match = ramda.match(rx, raw)
if (match.length > 0) {
return match[0]
} else {
re... | [
"function",
"defaultVersionMatcher",
"(",
"raw",
")",
"{",
"// sanity check",
"if",
"(",
"ramda",
".",
"isNil",
"(",
"raw",
")",
"||",
"ramda",
".",
"isEmpty",
"(",
"raw",
")",
")",
"return",
"null",
"try",
"{",
"// look for something that looks like semver",
... | Extracts the version number from a somewhere within a string.
This looks for things that look like semver (e.g. 0.0.0) and picks the first one.
@param {string} raw - The raw text which came from running the version command. | [
"Extracts",
"the",
"version",
"number",
"from",
"a",
"somewhere",
"within",
"a",
"string",
"."
] | dca91da22f9ad9bab1eb9f43565689d563bd111d | https://github.com/infinitered/ignite/blob/dca91da22f9ad9bab1eb9f43565689d563bd111d/src/cli/enforce-global.js#L15-L32 | train | default version matcher | [
30522,
3853,
12398,
27774,
18900,
7474,
1006,
6315,
1007,
1063,
1013,
1013,
20039,
4638,
2065,
1006,
8223,
2850,
1012,
3475,
4014,
1006,
6315,
1007,
1064,
1064,
8223,
2850,
1012,
2003,
6633,
13876,
2100,
1006,
6315,
1007,
1007,
2709,
19701,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/project/ProjectManager.js | createNewItem | function createNewItem(baseDir, initialName, skipRename, isFolder) {
baseDir = model.getDirectoryInProject(baseDir);
if (skipRename) {
if(isFolder) {
return model.createAtPath(baseDir + initialName + "/");
}
return model.createAtPath(baseDir + initial... | javascript | function createNewItem(baseDir, initialName, skipRename, isFolder) {
baseDir = model.getDirectoryInProject(baseDir);
if (skipRename) {
if(isFolder) {
return model.createAtPath(baseDir + initialName + "/");
}
return model.createAtPath(baseDir + initial... | [
"function",
"createNewItem",
"(",
"baseDir",
",",
"initialName",
",",
"skipRename",
",",
"isFolder",
")",
"{",
"baseDir",
"=",
"model",
".",
"getDirectoryInProject",
"(",
"baseDir",
")",
";",
"if",
"(",
"skipRename",
")",
"{",
"if",
"(",
"isFolder",
")",
"... | Create a new item in the current project.
@param baseDir {string|Directory} Full path of the directory where the item should go.
Defaults to the project root if the entry is not valid or not within the project.
@param initialName {string} Initial name for the item
@param skipRename {boolean} If true, don't allow the u... | [
"Create",
"a",
"new",
"item",
"in",
"the",
"current",
"project",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/ProjectManager.js#L1114-L1124 | train | Create a new item | [
30522,
3853,
3443,
2638,
9148,
18532,
1006,
2241,
4313,
1010,
3988,
18442,
1010,
13558,
7389,
14074,
1010,
2003,
10371,
2121,
1007,
1063,
2241,
4313,
1027,
2944,
1012,
2131,
4305,
2890,
16761,
25811,
21572,
20614,
1006,
2241,
4313,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mui-org/material-ui | docs/src/pages/components/grid-list/ImageGridList.js | ImageGridList | function ImageGridList() {
const classes = useStyles();
return (
<div className={classes.root}>
<GridList cellHeight={160} className={classes.gridList} cols={3}>
{tileData.map(tile => (
<GridListTile key={tile.img} cols={tile.cols || 1}>
<img src={tile.img} alt={tile.title} ... | javascript | function ImageGridList() {
const classes = useStyles();
return (
<div className={classes.root}>
<GridList cellHeight={160} className={classes.gridList} cols={3}>
{tileData.map(tile => (
<GridListTile key={tile.img} cols={tile.cols || 1}>
<img src={tile.img} alt={tile.title} ... | [
"function",
"ImageGridList",
"(",
")",
"{",
"const",
"classes",
"=",
"useStyles",
"(",
")",
";",
"return",
"(",
"<",
"div",
"className",
"=",
"{",
"classes",
".",
"root",
"}",
">",
"\n ",
"<",
"GridList",
"cellHeight",
"=",
"{",
"160",
"}",
"class... | The example data is structured as follows:
import image from 'path/to/image.jpg';
[etc...]
const tileData = [
{
img: image,
title: 'Image',
author: 'author',
cols: 2,
},
{
[etc...]
},
]; | [
"The",
"example",
"data",
"is",
"structured",
"as",
"follows",
":"
] | 1555e52367835946382fbf2a8f681de71318915d | https://github.com/mui-org/material-ui/blob/1555e52367835946382fbf2a8f681de71318915d/docs/src/pages/components/grid-list/ImageGridList.js#L39-L53 | train | Creates an image grid list | [
30522,
3853,
3746,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/performance/XHRInterceptor.js | createOverride | function createOverride(sXHRMethod) {
mRegistry[sXHRMethod] = Object.create(null);
// backup the original function
mXHRFunctions[sXHRMethod] = window.XMLHttpRequest.prototype[sXHRMethod];
window.XMLHttpRequest.prototype[sXHRMethod] = function() {
var oArgs = arguments;
// call the original function f... | javascript | function createOverride(sXHRMethod) {
mRegistry[sXHRMethod] = Object.create(null);
// backup the original function
mXHRFunctions[sXHRMethod] = window.XMLHttpRequest.prototype[sXHRMethod];
window.XMLHttpRequest.prototype[sXHRMethod] = function() {
var oArgs = arguments;
// call the original function f... | [
"function",
"createOverride",
"(",
"sXHRMethod",
")",
"{",
"mRegistry",
"[",
"sXHRMethod",
"]",
"=",
"Object",
".",
"create",
"(",
"null",
")",
";",
"// backup the original function",
"mXHRFunctions",
"[",
"sXHRMethod",
"]",
"=",
"window",
".",
"XMLHttpRequest",
... | Creates the initial override for an original XHR method.
@param {string} sXHRMethod Name of the actual XHR method
@param {function} fnCallback The registered callback function
@private | [
"Creates",
"the",
"initial",
"override",
"for",
"an",
"original",
"XHR",
"method",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/performance/XHRInterceptor.js#L45-L65 | train | Creates a function that will be called when an XHR method is called. | [
30522,
3853,
3443,
7840,
15637,
1006,
1055,
2595,
8093,
11368,
6806,
2094,
1007,
1063,
2720,
13910,
2923,
2854,
1031,
1055,
2595,
8093,
11368,
6806,
2094,
1033,
1027,
4874,
1012,
3443,
1006,
19701,
1007,
1025,
1013,
1013,
10200,
1996,
2434,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/CodeInspection.js | getProviderIDsForLanguage | function getProviderIDsForLanguage(languageId) {
if (!_providers[languageId]) {
return [];
}
return _providers[languageId].map(function (provider) {
return provider.name;
});
} | javascript | function getProviderIDsForLanguage(languageId) {
if (!_providers[languageId]) {
return [];
}
return _providers[languageId].map(function (provider) {
return provider.name;
});
} | [
"function",
"getProviderIDsForLanguage",
"(",
"languageId",
")",
"{",
"if",
"(",
"!",
"_providers",
"[",
"languageId",
"]",
")",
"{",
"return",
"[",
"]",
";",
"}",
"return",
"_providers",
"[",
"languageId",
"]",
".",
"map",
"(",
"function",
"(",
"provider"... | Returns an array of the IDs of providers registered for a specific language
@param {!string} languageId
@return {Array.<string>} Names of registered providers. | [
"Returns",
"an",
"array",
"of",
"the",
"IDs",
"of",
"providers",
"registered",
"for",
"a",
"specific",
"language"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CodeInspection.js#L196-L203 | train | Get the provider names for a language | [
30522,
3853,
2131,
21572,
17258,
11124,
5104,
29278,
25023,
6692,
3351,
1006,
2653,
3593,
1007,
1063,
2065,
1006,
999,
1035,
11670,
1031,
2653,
3593,
1033,
1007,
1063,
2709,
1031,
1033,
1025,
1065,
2709,
1035,
11670,
1031,
2653,
3593,
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... |
GeekyAnts/vue-native-core | dist/vue.runtime.common.js | initGlobalAPI | function initGlobalAPI (Vue) {
// config
var configDef = {};
configDef.get = function () { return config; };
if (process.env.NODE_ENV !== 'production') {
configDef.set = function () {
warn(
'Do not replace the Vue.config object, set individual fields instead.'
);
};
}
Object.defi... | javascript | function initGlobalAPI (Vue) {
// config
var configDef = {};
configDef.get = function () { return config; };
if (process.env.NODE_ENV !== 'production') {
configDef.set = function () {
warn(
'Do not replace the Vue.config object, set individual fields instead.'
);
};
}
Object.defi... | [
"function",
"initGlobalAPI",
"(",
"Vue",
")",
"{",
"// config",
"var",
"configDef",
"=",
"{",
"}",
";",
"configDef",
".",
"get",
"=",
"function",
"(",
")",
"{",
"return",
"config",
";",
"}",
";",
"if",
"(",
"process",
".",
"env",
".",
"NODE_ENV",
"!=... | /* | [
"/",
"*"
] | a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e | https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/dist/vue.runtime.common.js#L3899-L3941 | train | Initialize the global API. | [
30522,
3853,
1999,
4183,
23296,
16429,
7911,
8197,
1006,
24728,
2063,
1007,
1063,
1013,
1013,
9530,
8873,
2290,
13075,
9530,
8873,
2290,
3207,
2546,
1027,
1063,
1065,
1025,
9530,
8873,
2290,
3207,
2546,
1012,
2131,
1027,
3853,
1006,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dequelabs/axe-core | lib/core/utils/preload-cssom.js | filerStyleAndLinkAttributesInDocumentFragment | function filerStyleAndLinkAttributesInDocumentFragment(node) {
const nodeName = node.nodeName.toUpperCase();
const linkHref = node.getAttribute('href');
const linkRel = node.getAttribute('rel');
const isLink =
nodeName === 'LINK' &&
linkHref &&
linkRel &&
node.rel.toUpperCase().includes('STYLESHEET');
cons... | javascript | function filerStyleAndLinkAttributesInDocumentFragment(node) {
const nodeName = node.nodeName.toUpperCase();
const linkHref = node.getAttribute('href');
const linkRel = node.getAttribute('rel');
const isLink =
nodeName === 'LINK' &&
linkHref &&
linkRel &&
node.rel.toUpperCase().includes('STYLESHEET');
cons... | [
"function",
"filerStyleAndLinkAttributesInDocumentFragment",
"(",
"node",
")",
"{",
"const",
"nodeName",
"=",
"node",
".",
"nodeName",
".",
"toUpperCase",
"(",
")",
";",
"const",
"linkHref",
"=",
"node",
".",
"getAttribute",
"(",
"'href'",
")",
";",
"const",
"... | Get all `<style></style>` and `<link>` attributes
-> limit to only `style` or `link` attributes with `rel=stylesheet` and `media != print`
@param {Object} node HTMLElement
@returns {Boolean} | [
"Get",
"all",
"<style",
">",
"<",
"/",
"style",
">",
"and",
"<link",
">",
"attributes",
"-",
">",
"limit",
"to",
"only",
"style",
"or",
"link",
"attributes",
"with",
"rel",
"=",
"stylesheet",
"and",
"media",
"!",
"=",
"print"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/utils/preload-cssom.js#L409-L420 | train | Returns true if the node is a style element and the link attribute is a print | [
30522,
3853,
5371,
12096,
12844,
5685,
13767,
19321,
3089,
8569,
4570,
22254,
10085,
27417,
24475,
29181,
3672,
1006,
13045,
1007,
1063,
9530,
3367,
13045,
18442,
1027,
13045,
1012,
13045,
18442,
1012,
2000,
29547,
18992,
3366,
1006,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.rta/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js | function (oElement, mAction) {
var oDefaultAggregation = oElement.getMetadata().getAggregation();
var sAggregationName = oDefaultAggregation ? oDefaultAggregation.name : mAction.action.aggregation;
var oModel = oElement.getModel();
return Promise.resolve()
.then(function () {
return _getODataPrope... | javascript | function (oElement, mAction) {
var oDefaultAggregation = oElement.getMetadata().getAggregation();
var sAggregationName = oDefaultAggregation ? oDefaultAggregation.name : mAction.action.aggregation;
var oModel = oElement.getModel();
return Promise.resolve()
.then(function () {
return _getODataPrope... | [
"function",
"(",
"oElement",
",",
"mAction",
")",
"{",
"var",
"oDefaultAggregation",
"=",
"oElement",
".",
"getMetadata",
"(",
")",
".",
"getAggregation",
"(",
")",
";",
"var",
"sAggregationName",
"=",
"oDefaultAggregation",
"?",
"oDefaultAggregation",
".",
"nam... | Retrieves available OData properties from the metadata
@param {sap.ui.core.Control} oElement - Source element of which Model we're looking for additional properties
@param {Object} mAction - Action descriptor
@return {Promise} - returns a Promise which resolves with a list of available to display OData properties | [
"Retrieves",
"available",
"OData",
"properties",
"from",
"the",
"metadata"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js#L519-L560 | train | Returns the additional elements of the given element that are not bound to the given aggregation. | [
30522,
3853,
1006,
1051,
12260,
3672,
1010,
6097,
3508,
1007,
1063,
13075,
24040,
7011,
11314,
8490,
17603,
12540,
1027,
1051,
12260,
3672,
1012,
2131,
11368,
8447,
2696,
1006,
1007,
1012,
2131,
8490,
17603,
12540,
1006,
1007,
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... | |
SheetJS/js-xlsx | xlsx.js | write_ws_biff8 | function write_ws_biff8(idx, opts, wb) {
var ba = buf_array();
var s = wb.SheetNames[idx], ws = wb.Sheets[s] || {};
var _WB = ((wb||{}).Workbook||{});
var _sheet = ((_WB.Sheets||[])[idx]||{});
var dense = Array.isArray(ws);
var b8 = opts.biff == 8;
var ref, rr = "", cols = [];
var range = safe_decode_range(ws['... | javascript | function write_ws_biff8(idx, opts, wb) {
var ba = buf_array();
var s = wb.SheetNames[idx], ws = wb.Sheets[s] || {};
var _WB = ((wb||{}).Workbook||{});
var _sheet = ((_WB.Sheets||[])[idx]||{});
var dense = Array.isArray(ws);
var b8 = opts.biff == 8;
var ref, rr = "", cols = [];
var range = safe_decode_range(ws['... | [
"function",
"write_ws_biff8",
"(",
"idx",
",",
"opts",
",",
"wb",
")",
"{",
"var",
"ba",
"=",
"buf_array",
"(",
")",
";",
"var",
"s",
"=",
"wb",
".",
"SheetNames",
"[",
"idx",
"]",
",",
"ws",
"=",
"wb",
".",
"Sheets",
"[",
"s",
"]",
"||",
"{",
... | /* [MS-XLS] 2.1.7.20.5 | [
"/",
"*",
"[",
"MS",
"-",
"XLS",
"]",
"2",
".",
"1",
".",
"7",
".",
"20",
".",
"5"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L18674-L18736 | train | Write a sheet to a buffer | [
30522,
3853,
4339,
1035,
1059,
2015,
1035,
12170,
4246,
2620,
1006,
8909,
2595,
1010,
23569,
2015,
1010,
25610,
1007,
1063,
13075,
8670,
1027,
20934,
2546,
1035,
9140,
1006,
1007,
1025,
13075,
1055,
1027,
25610,
1012,
7123,
18442,
2015,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.fl/src/sap/ui/fl/Utils.js | function (oManifest) {
var sVersion = "";
if (oManifest){
var oSapApp = (oManifest.getEntry) ? oManifest.getEntry("sap.app") : oManifest["sap.app"];
if (oSapApp && oSapApp.applicationVersion && oSapApp.applicationVersion.version){
sVersion = oSapApp.applicationVersion.version;
}
} else {
t... | javascript | function (oManifest) {
var sVersion = "";
if (oManifest){
var oSapApp = (oManifest.getEntry) ? oManifest.getEntry("sap.app") : oManifest["sap.app"];
if (oSapApp && oSapApp.applicationVersion && oSapApp.applicationVersion.version){
sVersion = oSapApp.applicationVersion.version;
}
} else {
t... | [
"function",
"(",
"oManifest",
")",
"{",
"var",
"sVersion",
"=",
"\"\"",
";",
"if",
"(",
"oManifest",
")",
"{",
"var",
"oSapApp",
"=",
"(",
"oManifest",
".",
"getEntry",
")",
"?",
"oManifest",
".",
"getEntry",
"(",
"\"sap.app\"",
")",
":",
"oManifest",
... | Returns the semantic application version using format: "major.minor.patch".
@param {object} oManifest - Manifest of the component
@returns {string} Version of application if it is available in the manifest, otherwise an empty string
@public | [
"Returns",
"the",
"semantic",
"application",
"version",
"using",
"format",
":",
"major",
".",
"minor",
".",
"patch",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/Utils.js#L1152-L1163 | train | Returns the version of the application | [
30522,
3853,
1006,
16640,
29323,
3367,
1007,
1063,
13075,
17917,
2545,
3258,
1027,
1000,
1000,
1025,
2065,
1006,
16640,
29323,
3367,
1007,
1063,
13075,
9808,
22068,
9397,
1027,
1006,
16640,
29323,
3367,
1012,
2131,
4765,
2854,
1007,
1029,
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 | lib/jsdoc/ui5/template/publish.js | getConstructorDescription | function getConstructorDescription(symbol) {
var description = symbol.description;
var tags = symbol.tags;
if ( tags ) {
for (var i = 0; i < tags.length; i++) {
if ( tags[i].title === "ui5-settings" && tags[i].text) {
description += "\n</p><p>\n" + tags[i].text;
break;
}
}
}
return description;
} | javascript | function getConstructorDescription(symbol) {
var description = symbol.description;
var tags = symbol.tags;
if ( tags ) {
for (var i = 0; i < tags.length; i++) {
if ( tags[i].title === "ui5-settings" && tags[i].text) {
description += "\n</p><p>\n" + tags[i].text;
break;
}
}
}
return description;
} | [
"function",
"getConstructorDescription",
"(",
"symbol",
")",
"{",
"var",
"description",
"=",
"symbol",
".",
"description",
";",
"var",
"tags",
"=",
"symbol",
".",
"tags",
";",
"if",
"(",
"tags",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"... | Description + Settings | [
"Description",
"+",
"Settings"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/lib/jsdoc/ui5/template/publish.js#L4094-L4106 | train | Get constructor description | [
30522,
3853,
2131,
8663,
3367,
6820,
16761,
6155,
23235,
3258,
1006,
6454,
1007,
1063,
13075,
6412,
1027,
6454,
1012,
6412,
1025,
13075,
22073,
1027,
6454,
1012,
22073,
1025,
2065,
1006,
22073,
1007,
1063,
2005,
1006,
13075,
1045,
1027,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/LiveDevelopment/LiveDevelopment.js | _onError | function _onError(event, error, msgData) {
var message;
// Sometimes error.message is undefined
if (!error.message) {
console.warn("Expected a non-empty string in error.message, got this instead:", error.message);
message = JSON.stringify(error);
} else {
... | javascript | function _onError(event, error, msgData) {
var message;
// Sometimes error.message is undefined
if (!error.message) {
console.warn("Expected a non-empty string in error.message, got this instead:", error.message);
message = JSON.stringify(error);
} else {
... | [
"function",
"_onError",
"(",
"event",
",",
"error",
",",
"msgData",
")",
"{",
"var",
"message",
";",
"// Sometimes error.message is undefined",
"if",
"(",
"!",
"error",
".",
"message",
")",
"{",
"console",
".",
"warn",
"(",
"\"Expected a non-empty string in error.... | Triggered by Inspector.error | [
"Triggered",
"by",
"Inspector",
".",
"error"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevelopment.js#L473-L497 | train | Error handler for the error event | [
30522,
3853,
1035,
2028,
18933,
2099,
1006,
2724,
1010,
7561,
1010,
5796,
2290,
2850,
2696,
1007,
1063,
13075,
4471,
1025,
1013,
1013,
2823,
7561,
1012,
4471,
2003,
6151,
28344,
2065,
1006,
999,
7561,
1012,
4471,
1007,
1063,
10122,
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... |
dcloudio/mui | examples/hello-mui/js/mui.js | function(time) {
if (this.pulldown && !this.disablePulldown) {
if (this.y >= this.options.down.height) {
this.pulldownLoading(undefined, time || 0);
return true;
} else {
!this.loading && this.topPocket.classList.rem... | javascript | function(time) {
if (this.pulldown && !this.disablePulldown) {
if (this.y >= this.options.down.height) {
this.pulldownLoading(undefined, time || 0);
return true;
} else {
!this.loading && this.topPocket.classList.rem... | [
"function",
"(",
"time",
")",
"{",
"if",
"(",
"this",
".",
"pulldown",
"&&",
"!",
"this",
".",
"disablePulldown",
")",
"{",
"if",
"(",
"this",
".",
"y",
">=",
"this",
".",
"options",
".",
"down",
".",
"height",
")",
"{",
"this",
".",
"pulldownLoadi... | API | [
"API"
] | ff74c90a1671a552f3604b1288bf38a4126312d0 | https://github.com/dcloudio/mui/blob/ff74c90a1671a552f3604b1288bf38a4126312d0/examples/hello-mui/js/mui.js#L4625-L4635 | train | Called when the user is trying to pull down | [
30522,
3853,
1006,
2051,
1007,
1063,
2065,
1006,
2023,
1012,
4139,
7698,
1004,
1004,
999,
2023,
1012,
4487,
19150,
14289,
3363,
7698,
1007,
1063,
2065,
1006,
2023,
1012,
1061,
1028,
1027,
2023,
1012,
7047,
1012,
2091,
1012,
4578,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
GitbookIO/gitbook | lib/api/encodePage.js | encodePage | function encodePage(output, page) {
var book = output.getBook();
var summary = book.getSummary();
var fs = book.getContentFS();
var file = page.getFile();
// JS Page is based on the JSON output
var result = JSONUtils.encodePage(page, summary);
result.type = file.getType();
result.path ... | javascript | function encodePage(output, page) {
var book = output.getBook();
var summary = book.getSummary();
var fs = book.getContentFS();
var file = page.getFile();
// JS Page is based on the JSON output
var result = JSONUtils.encodePage(page, summary);
result.type = file.getType();
result.path ... | [
"function",
"encodePage",
"(",
"output",
",",
"page",
")",
"{",
"var",
"book",
"=",
"output",
".",
"getBook",
"(",
")",
";",
"var",
"summary",
"=",
"book",
".",
"getSummary",
"(",
")",
";",
"var",
"fs",
"=",
"book",
".",
"getContentFS",
"(",
")",
"... | Encode a page in a context to a JS API
@param {Output} output
@param {Page} page
@return {Object} | [
"Encode",
"a",
"page",
"in",
"a",
"context",
"to",
"a",
"JS",
"API"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/api/encodePage.js#L12-L37 | train | Encode a page | [
30522,
3853,
4372,
16044,
13704,
1006,
6434,
1010,
3931,
1007,
1063,
13075,
2338,
1027,
6434,
1012,
2131,
8654,
1006,
1007,
1025,
13075,
12654,
1027,
2338,
1012,
4152,
2819,
7849,
2100,
1006,
1007,
1025,
13075,
1042,
2015,
1027,
2338,
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/LiveDevelopment/Inspector/Inspector.js | _onMessage | function _onMessage(message) {
var response = JSON.parse(message.data),
msgRecord = _messageCallbacks[response.id],
callback = msgRecord && msgRecord.callback,
msgText = (msgRecord && msgRecord.message) || "No message";
if (msgRecord) {
// Mes... | javascript | function _onMessage(message) {
var response = JSON.parse(message.data),
msgRecord = _messageCallbacks[response.id],
callback = msgRecord && msgRecord.callback,
msgText = (msgRecord && msgRecord.message) || "No message";
if (msgRecord) {
// Mes... | [
"function",
"_onMessage",
"(",
"message",
")",
"{",
"var",
"response",
"=",
"JSON",
".",
"parse",
"(",
"message",
".",
"data",
")",
",",
"msgRecord",
"=",
"_messageCallbacks",
"[",
"response",
".",
"id",
"]",
",",
"callback",
"=",
"msgRecord",
"&&",
"msg... | Received message from the WebSocket
A message can be one of three things:
1. an error -> report it
2. the response to a previous command -> run the stored callback
3. an event -> trigger an event handler method
@param {object} message | [
"Received",
"message",
"from",
"the",
"WebSocket",
"A",
"message",
"can",
"be",
"one",
"of",
"three",
"things",
":",
"1",
".",
"an",
"error",
"-",
">",
"report",
"it",
"2",
".",
"the",
"response",
"to",
"a",
"previous",
"command",
"-",
">",
"run",
"t... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Inspector/Inspector.js#L210-L235 | train | callback function for all messages | [
30522,
3853,
1035,
2006,
7834,
3736,
3351,
1006,
4471,
1007,
1063,
13075,
3433,
1027,
1046,
3385,
1012,
11968,
3366,
1006,
4471,
1012,
2951,
1007,
1010,
5796,
17603,
27108,
2094,
1027,
1035,
4471,
9289,
20850,
8684,
2015,
1031,
3433,
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... |
vuejs/vuepress | packages/@vuepress/core/lib/node/internal-plugins/routes.js | routesCode | function routesCode (pages) {
function genRoute ({
path: pagePath,
key: componentName,
frontmatter: {
layout
},
regularPath,
_meta
}) {
let code = `
{
name: ${JSON.stringify(componentName)},
path: ${JSON.stringify(pagePath)},
component: GlobalLayout,
beforeEnter: ... | javascript | function routesCode (pages) {
function genRoute ({
path: pagePath,
key: componentName,
frontmatter: {
layout
},
regularPath,
_meta
}) {
let code = `
{
name: ${JSON.stringify(componentName)},
path: ${JSON.stringify(pagePath)},
component: GlobalLayout,
beforeEnter: ... | [
"function",
"routesCode",
"(",
"pages",
")",
"{",
"function",
"genRoute",
"(",
"{",
"path",
":",
"pagePath",
",",
"key",
":",
"componentName",
",",
"frontmatter",
":",
"{",
"layout",
"}",
",",
"regularPath",
",",
"_meta",
"}",
")",
"{",
"let",
"code",
... | Get Vue routes code.
@param {array} pages
@returns {string} | [
"Get",
"Vue",
"routes",
"code",
"."
] | 15784acc0cf2e87de3c147895b2c3977b0195d78 | https://github.com/vuejs/vuepress/blob/15784acc0cf2e87de3c147895b2c3977b0195d78/packages/@vuepress/core/lib/node/internal-plugins/routes.js#L31-L88 | train | Generate code for all routes | [
30522,
3853,
5847,
16044,
1006,
5530,
1007,
1063,
3853,
8991,
22494,
2618,
1006,
1063,
4130,
1024,
3931,
15069,
1010,
3145,
1024,
6922,
18442,
1010,
2392,
18900,
3334,
1024,
1063,
9621,
1065,
1010,
3180,
15069,
1010,
1035,
18804,
1065,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.codeeditor/src/sap/ui/codeeditor/js/ace/worker-javascript.js | each | function each(obj, cb) {
if (!obj)
return;
if (!Array.isArray(obj) && typeof obj === "object")
obj = Object.keys(obj);
obj.forEach(cb);
} | javascript | function each(obj, cb) {
if (!obj)
return;
if (!Array.isArray(obj) && typeof obj === "object")
obj = Object.keys(obj);
obj.forEach(cb);
} | [
"function",
"each",
"(",
"obj",
",",
"cb",
")",
"{",
"if",
"(",
"!",
"obj",
")",
"return",
";",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"obj",
")",
"&&",
"typeof",
"obj",
"===",
"\"object\"",
")",
"obj",
"=",
"Object",
".",
"keys",
"(",
"... | Variables that live outside the current file | [
"Variables",
"that",
"live",
"outside",
"the",
"current",
"file"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.codeeditor/src/sap/ui/codeeditor/js/ace/worker-javascript.js#L7837-L7845 | train | Iterate over the objects in the cache | [
30522,
3853,
2169,
1006,
27885,
3501,
1010,
17324,
1007,
1063,
2065,
1006,
999,
27885,
3501,
1007,
2709,
1025,
2065,
1006,
999,
9140,
1012,
18061,
11335,
2100,
1006,
27885,
3501,
1007,
1004,
1004,
2828,
11253,
27885,
3501,
1027,
1027,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/jszip.js | function(buf, crc) {
var c = (typeof(crc) == "undefined" ? 0 : crc) ^ 0xffffffff;
var bArray = typeof buf !== "string";
var n;
if (bArray) {
for (n = 0; n < buf.length; n++) {
c = SAP_CRC32_TABLE[(c ^ buf[n]) & 0xff] ^ (c >>> 8);
}
} else {
for (n = 0; ... | javascript | function(buf, crc) {
var c = (typeof(crc) == "undefined" ? 0 : crc) ^ 0xffffffff;
var bArray = typeof buf !== "string";
var n;
if (bArray) {
for (n = 0; n < buf.length; n++) {
c = SAP_CRC32_TABLE[(c ^ buf[n]) & 0xff] ^ (c >>> 8);
}
} else {
for (n = 0; ... | [
"function",
"(",
"buf",
",",
"crc",
")",
"{",
"var",
"c",
"=",
"(",
"typeof",
"(",
"crc",
")",
"==",
"\"undefined\"",
"?",
"0",
":",
"crc",
")",
"^",
"0xffffffff",
";",
"var",
"bArray",
"=",
"typeof",
"buf",
"!==",
"\"string\"",
";",
"var",
"n",
... | ##### BEGIN: MODIFIED BY SAP functions crc32, utf8encode and utf8decode are replaced with implementations by SAP | [
"#####",
"BEGIN",
":",
"MODIFIED",
"BY",
"SAP",
"functions",
"crc32",
"utf8encode",
"and",
"utf8decode",
"are",
"replaced",
"with",
"implementations",
"by",
"SAP"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/jszip.js#L1121-L1138 | train | Compute the CRC32 of the given buffer | [
30522,
3853,
1006,
20934,
2546,
1010,
13675,
2278,
1007,
1063,
13075,
1039,
1027,
1006,
2828,
11253,
1006,
13675,
2278,
1007,
1027,
1027,
1000,
6151,
28344,
1000,
1029,
1014,
1024,
13675,
2278,
1007,
1034,
1014,
2595,
4246,
4246,
4246,
4246... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
swimlane/ngx-datatable | release/utils/camel-case.js | camelCase | function camelCase(str) {
// Replace special characters with a space
str = str.replace(/[^a-zA-Z0-9 ]/g, ' ');
// put a space before an uppercase letter
str = str.replace(/([a-z](?=[A-Z]))/g, '$1 ');
// Lower case first character and some other stuff
str = str.replace(/([^a-zA-Z0-9 ])|^[0-9]+/g,... | javascript | function camelCase(str) {
// Replace special characters with a space
str = str.replace(/[^a-zA-Z0-9 ]/g, ' ');
// put a space before an uppercase letter
str = str.replace(/([a-z](?=[A-Z]))/g, '$1 ');
// Lower case first character and some other stuff
str = str.replace(/([^a-zA-Z0-9 ])|^[0-9]+/g,... | [
"function",
"camelCase",
"(",
"str",
")",
"{",
"// Replace special characters with a space",
"str",
"=",
"str",
".",
"replace",
"(",
"/",
"[^a-zA-Z0-9 ]",
"/",
"g",
",",
"' '",
")",
";",
"// put a space before an uppercase letter",
"str",
"=",
"str",
".",
"replace... | Converts strings from something to camel case
http://stackoverflow.com/questions/10425287/convert-dash-separated-string-to-camelcase | [
"Converts",
"strings",
"from",
"something",
"to",
"camel",
"case",
"http",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"questions",
"/",
"10425287",
"/",
"convert",
"-",
"dash",
"-",
"separated",
"-",
"string",
"-",
"to",
"-",
"camelcase"
] | d7df15a070282a169524dba51d9572008b74804c | https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/camel-case.js#L7-L19 | train | Convert a string to camelCase | [
30522,
3853,
19130,
18382,
1006,
2358,
2099,
1007,
1063,
1013,
1013,
5672,
2569,
3494,
2007,
1037,
2686,
2358,
2099,
1027,
2358,
2099,
1012,
5672,
1006,
1013,
1031,
1034,
1037,
1011,
23564,
1011,
1062,
2692,
1011,
1023,
1033,
1013,
1043,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
airyland/vux | src/components/clocker/clocker.js | pluralize | function pluralize (format, count) {
var plural = 's'
var singular = ''
if (format) {
format = format.replace(/(:||\s)/gi, '').split(/,/)
if (format.length === 1) {
plural = format[0]
} else {
singular = format[0]
plural = format[1]
}
}
if (Math.abs(count) === 1) {
return... | javascript | function pluralize (format, count) {
var plural = 's'
var singular = ''
if (format) {
format = format.replace(/(:||\s)/gi, '').split(/,/)
if (format.length === 1) {
plural = format[0]
} else {
singular = format[0]
plural = format[1]
}
}
if (Math.abs(count) === 1) {
return... | [
"function",
"pluralize",
"(",
"format",
",",
"count",
")",
"{",
"var",
"plural",
"=",
"'s'",
"var",
"singular",
"=",
"''",
"if",
"(",
"format",
")",
"{",
"format",
"=",
"format",
".",
"replace",
"(",
"/",
"(:||\\s)",
"/",
"gi",
",",
"''",
")",
".",... | Pluralize | [
"Pluralize"
] | 484fc3c18bdca99b0c08efbb678c0ee0f5ceedd6 | https://github.com/airyland/vux/blob/484fc3c18bdca99b0c08efbb678c0ee0f5ceedd6/src/components/clocker/clocker.js#L117-L134 | train | Pluralize the given number of words in a given format | [
30522,
3853,
13994,
4697,
1006,
4289,
1010,
4175,
1007,
1063,
13075,
30524,
1012,
5672,
1006,
1013,
1006,
1024,
1064,
1064,
1032,
1055,
1007,
1013,
21025,
1010,
1005,
1005,
1007,
1012,
3975,
1006,
1013,
1010,
1013,
1007,
2065,
1006,
4289,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
NetEase/pomelo | lib/util/appUtil.js | function(app) {
app.loadConfigBaseApp(Constants.RESERVED.MASTER, Constants.FILEPATH.MASTER);
app.master = app.get(Constants.RESERVED.MASTER);
} | javascript | function(app) {
app.loadConfigBaseApp(Constants.RESERVED.MASTER, Constants.FILEPATH.MASTER);
app.master = app.get(Constants.RESERVED.MASTER);
} | [
"function",
"(",
"app",
")",
"{",
"app",
".",
"loadConfigBaseApp",
"(",
"Constants",
".",
"RESERVED",
".",
"MASTER",
",",
"Constants",
".",
"FILEPATH",
".",
"MASTER",
")",
";",
"app",
".",
"master",
"=",
"app",
".",
"get",
"(",
"Constants",
".",
"RESER... | Load master info from config/master.json. | [
"Load",
"master",
"info",
"from",
"config",
"/",
"master",
".",
"json",
"."
] | defcf019631ed399cc4dad932d3b028a04a039a4 | https://github.com/NetEase/pomelo/blob/defcf019631ed399cc4dad932d3b028a04a039a4/lib/util/appUtil.js#L155-L158 | train | Load the master config | [
30522,
3853,
1006,
10439,
1007,
1063,
10439,
1012,
7170,
8663,
8873,
18259,
11022,
29098,
1006,
5377,
2015,
1012,
9235,
1012,
3040,
1010,
5377,
2015,
1012,
5371,
15069,
1012,
3040,
1007,
1025,
10439,
1012,
3040,
1027,
10439,
1012,
2131,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
expressjs/express | lib/router/index.js | gettype | function gettype(obj) {
var type = typeof obj;
if (type !== 'object') {
return type;
}
// inspect [[Class]] for objects
return toString.call(obj)
.replace(objectRegExp, '$1');
} | javascript | function gettype(obj) {
var type = typeof obj;
if (type !== 'object') {
return type;
}
// inspect [[Class]] for objects
return toString.call(obj)
.replace(objectRegExp, '$1');
} | [
"function",
"gettype",
"(",
"obj",
")",
"{",
"var",
"type",
"=",
"typeof",
"obj",
";",
"if",
"(",
"type",
"!==",
"'object'",
")",
"{",
"return",
"type",
";",
"}",
"// inspect [[Class]] for objects",
"return",
"toString",
".",
"call",
"(",
"obj",
")",
"."... | get type for error message | [
"get",
"type",
"for",
"error",
"message"
] | dc538f6e810bd462c98ee7e6aae24c64d4b1da93 | https://github.com/expressjs/express/blob/dc538f6e810bd462c98ee7e6aae24c64d4b1da93/lib/router/index.js#L552-L562 | train | get type of obj | [
30522,
3853,
2131,
13874,
1006,
27885,
3501,
1007,
1063,
13075,
2828,
1027,
2828,
11253,
27885,
3501,
1025,
2065,
1006,
2828,
999,
1027,
1027,
1005,
4874,
1005,
1007,
1063,
2709,
2828,
1025,
1065,
1013,
1013,
22459,
1031,
1031,
2465,
1033,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-echarts | src/coord/View.js | function () {
// Must update after view transform updated
var rawTransformMatrix = this._rawTransformable.getLocalTransform();
var roamTransform = this._roamTransformable;
var defaultCenter = this.getDefaultCenter();
var center = this.getCenter();
var zoom = this.getZoom(... | javascript | function () {
// Must update after view transform updated
var rawTransformMatrix = this._rawTransformable.getLocalTransform();
var roamTransform = this._roamTransformable;
var defaultCenter = this.getDefaultCenter();
var center = this.getCenter();
var zoom = this.getZoom(... | [
"function",
"(",
")",
"{",
"// Must update after view transform updated",
"var",
"rawTransformMatrix",
"=",
"this",
".",
"_rawTransformable",
".",
"getLocalTransform",
"(",
")",
";",
"var",
"roamTransform",
"=",
"this",
".",
"_roamTransformable",
";",
"var",
"defaultC... | Remove roam | [
"Remove",
"roam"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/coord/View.js#L189-L208 | train | Update view transform | [
30522,
3853,
1006,
1007,
1063,
1013,
1013,
2442,
10651,
2044,
3193,
10938,
7172,
13075,
6315,
6494,
3619,
14192,
18900,
17682,
1027,
2023,
1012,
1035,
6315,
6494,
3619,
14192,
3085,
1012,
2131,
4135,
9289,
6494,
3619,
14192,
1006,
1007,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
eslint/eslint | lib/rules/no-unused-vars.js | isForInRef | function isForInRef(ref) {
let target = ref.identifier.parent;
// "for (var ...) { return; }"
if (target.type === "VariableDeclarator") {
target = target.parent.parent;
}
if (target.type !== "ForInStatement") {
return false;
... | javascript | function isForInRef(ref) {
let target = ref.identifier.parent;
// "for (var ...) { return; }"
if (target.type === "VariableDeclarator") {
target = target.parent.parent;
}
if (target.type !== "ForInStatement") {
return false;
... | [
"function",
"isForInRef",
"(",
"ref",
")",
"{",
"let",
"target",
"=",
"ref",
".",
"identifier",
".",
"parent",
";",
"// \"for (var ...) { return; }\"",
"if",
"(",
"target",
".",
"type",
"===",
"\"VariableDeclarator\"",
")",
"{",
"target",
"=",
"target",
".",
... | Determine if an identifier is used either in for-in loops.
@param {Reference} ref - The reference to check.
@returns {boolean} whether reference is used in the for-in loops
@private | [
"Determine",
"if",
"an",
"identifier",
"is",
"used",
"either",
"in",
"for",
"-",
"in",
"loops",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-unused-vars.js#L424-L452 | train | Is the given reference a for in statement? | [
30522,
3853,
2003,
29278,
2378,
2890,
2546,
1006,
25416,
1007,
1063,
2292,
4539,
1027,
25416,
1012,
8909,
4765,
18095,
1012,
6687,
1025,
1013,
1013,
1000,
2005,
1006,
13075,
1012,
1012,
1012,
1007,
1063,
2709,
1025,
1065,
1000,
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... |
GitbookIO/gitbook | lib/plugins/resolveVersion.js | resolveVersion | function resolveVersion(plugin) {
var npmId = Plugin.nameToNpmID(plugin.getName());
var requiredVersion = plugin.getVersion();
if (plugin.isGitDependency()) {
return Promise.resolve(requiredVersion);
}
return initNPM()
.then(function() {
return Promise.nfcall(npm.commands.view,... | javascript | function resolveVersion(plugin) {
var npmId = Plugin.nameToNpmID(plugin.getName());
var requiredVersion = plugin.getVersion();
if (plugin.isGitDependency()) {
return Promise.resolve(requiredVersion);
}
return initNPM()
.then(function() {
return Promise.nfcall(npm.commands.view,... | [
"function",
"resolveVersion",
"(",
"plugin",
")",
"{",
"var",
"npmId",
"=",
"Plugin",
".",
"nameToNpmID",
"(",
"plugin",
".",
"getName",
"(",
")",
")",
";",
"var",
"requiredVersion",
"=",
"plugin",
".",
"getVersion",
"(",
")",
";",
"if",
"(",
"plugin",
... | Resolve a plugin dependency to a version
@param {PluginDependency} plugin
@return {Promise<String>} | [
"Resolve",
"a",
"plugin",
"dependency",
"to",
"a",
"version"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/plugins/resolveVersion.js#L33-L69 | train | Resolves the version of a plugin | [
30522,
3853,
10663,
27774,
1006,
13354,
2378,
1007,
1063,
13075,
27937,
4328,
2094,
1027,
13354,
2378,
1012,
2171,
2669,
9737,
3593,
1006,
13354,
2378,
1012,
2131,
18442,
1006,
1007,
1007,
1025,
13075,
3223,
27774,
1027,
13354,
2378,
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/project/WorkingSetView.js | _viewFromEl | function _viewFromEl($el) {
if (!$el.hasClass("working-set-view")) {
$el = $el.parents(".working-set-view");
}
var id = $el.attr("id").match(/working\-set\-list\-([\w]+[\w\d\-\.\:\_]*)/).pop();
return _views[id];
} | javascript | function _viewFromEl($el) {
if (!$el.hasClass("working-set-view")) {
$el = $el.parents(".working-set-view");
}
var id = $el.attr("id").match(/working\-set\-list\-([\w]+[\w\d\-\.\:\_]*)/).pop();
return _views[id];
} | [
"function",
"_viewFromEl",
"(",
"$el",
")",
"{",
"if",
"(",
"!",
"$el",
".",
"hasClass",
"(",
"\"working-set-view\"",
")",
")",
"{",
"$el",
"=",
"$el",
".",
"parents",
"(",
"\".working-set-view\"",
")",
";",
"}",
"var",
"id",
"=",
"$el",
".",
"attr",
... | Finds the WorkingSetView object for the specified element
@private
@param {jQuery} $el - the element to find the view for
@return {View} view object | [
"Finds",
"the",
"WorkingSetView",
"object",
"for",
"the",
"specified",
"element"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/WorkingSetView.js#L226-L233 | train | Get the view from an element | [
30522,
3853,
1035,
3193,
19699,
8462,
2140,
1006,
1002,
3449,
1007,
1063,
2065,
1006,
999,
1002,
3449,
1012,
2038,
26266,
1006,
1000,
2551,
1011,
2275,
1011,
3193,
1000,
1007,
1007,
1063,
1002,
3449,
1027,
1002,
3449,
1012,
3008,
1006,
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.table/src/sap/ui/table/TableAccExtension.js | function(oEvent) {
var oTable = this.getTable();
if (!oTable) {
return;
}
oTable.$("sapUiTableGridCnt").attr("role", ExtensionHelper.getAriaAttributesFor(this, "CONTENT", {}).role);
oTable._mTimeouts._cleanupACCExtension = setTimeout(function() {
var oTable = this.getTable();
if (!oTable) {
... | javascript | function(oEvent) {
var oTable = this.getTable();
if (!oTable) {
return;
}
oTable.$("sapUiTableGridCnt").attr("role", ExtensionHelper.getAriaAttributesFor(this, "CONTENT", {}).role);
oTable._mTimeouts._cleanupACCExtension = setTimeout(function() {
var oTable = this.getTable();
if (!oTable) {
... | [
"function",
"(",
"oEvent",
")",
"{",
"var",
"oTable",
"=",
"this",
".",
"getTable",
"(",
")",
";",
"if",
"(",
"!",
"oTable",
")",
"{",
"return",
";",
"}",
"oTable",
".",
"$",
"(",
"\"sapUiTableGridCnt\"",
")",
".",
"attr",
"(",
"\"role\"",
",",
"Ex... | Delegate for the focusout event.
@private
@param {jQuery.Event} oEvent The event object. | [
"Delegate",
"for",
"the",
"focusout",
"event",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableAccExtension.js#L976-L992 | train | Called when the user clicks on the grid | [
30522,
3853,
1006,
1051,
18697,
3372,
1007,
1063,
13075,
27178,
3085,
1027,
2023,
1012,
2131,
10880,
1006,
1007,
1025,
2065,
1006,
999,
27178,
3085,
1007,
1063,
2709,
1025,
1065,
27178,
3085,
1012,
1002,
1006,
1000,
20066,
14663,
3085,
1652... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/CodeFolding/foldhelpers/foldcode.js | doFold | function doFold(cm, pos, options, force) {
options = options || {};
force = force || "fold";
if (typeof pos === "number") {
pos = CodeMirror.Pos(pos, 0);
}
var finder = options.rangeFinder || CodeMirror.fold.auto,
range,
widget,
te... | javascript | function doFold(cm, pos, options, force) {
options = options || {};
force = force || "fold";
if (typeof pos === "number") {
pos = CodeMirror.Pos(pos, 0);
}
var finder = options.rangeFinder || CodeMirror.fold.auto,
range,
widget,
te... | [
"function",
"doFold",
"(",
"cm",
",",
"pos",
",",
"options",
",",
"force",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"force",
"=",
"force",
"||",
"\"fold\"",
";",
"if",
"(",
"typeof",
"pos",
"===",
"\"number\"",
")",
"{",
"pos",
"="... | Performs the folding and unfolding of code regions.
@param {CodeMirror} cm the CodeMirror instance
@param {number| Object} pos | [
"Performs",
"the",
"folding",
"and",
"unfolding",
"of",
"code",
"regions",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/foldhelpers/foldcode.js#L16-L112 | train | Folds the given position in the editor. | [
30522,
3853,
2079,
10371,
1006,
4642,
1010,
13433,
2015,
1010,
7047,
1010,
2486,
1007,
1063,
7047,
1027,
7047,
1064,
1064,
1063,
1065,
1025,
2486,
1027,
2486,
1064,
1064,
1000,
10671,
1000,
1025,
2065,
1006,
2828,
11253,
13433,
2015,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ecomfe/zrender | src/dom/HandlerProxy.js | function (event) {
event = normalizeEvent(this.dom, event);
// Mark touch, which is useful in distinguish touch and
// mouse event in upper applicatoin.
event.zrByTouch = true;
this.handler.processGesture(this, event, 'change');
// Mouse move should always be triggere... | javascript | function (event) {
event = normalizeEvent(this.dom, event);
// Mark touch, which is useful in distinguish touch and
// mouse event in upper applicatoin.
event.zrByTouch = true;
this.handler.processGesture(this, event, 'change');
// Mouse move should always be triggere... | [
"function",
"(",
"event",
")",
"{",
"event",
"=",
"normalizeEvent",
"(",
"this",
".",
"dom",
",",
"event",
")",
";",
"// Mark touch, which is useful in distinguish touch and",
"// mouse event in upper applicatoin.",
"event",
".",
"zrByTouch",
"=",
"true",
";",
"this",... | Touch移动响应函数
@inner
@param {Event} event | [
"Touch移动响应函数"
] | 30321b57cba3149c30eacb0c1e18276f0f001b9f | https://github.com/ecomfe/zrender/blob/30321b57cba3149c30eacb0c1e18276f0f001b9f/src/dom/HandlerProxy.js#L131-L147 | train | Handles mouse move and pinch events. | [
30522,
3853,
1006,
2724,
1007,
1063,
30524,
15185,
22123,
7140,
2818,
1027,
2995,
1025,
2023,
1012,
28213,
1012,
2832,
8449,
11244,
1006,
2023,
1010,
2724,
1010,
1005,
2689,
1005,
1007,
1025,
1013,
1013,
8000,
2693,
2323,
2467,
2022,
13330,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
eslint/eslint | lib/rules/no-self-assign.js | isSameMember | function isSameMember(left, right) {
if (!isSameProperty(left, right)) {
return false;
}
const lobj = left.object;
const robj = right.object;
if (lobj.type !== robj.type) {
return false;
}
if (lobj.type === "MemberExpression") {
return isSameMember(lobj, robj);
... | javascript | function isSameMember(left, right) {
if (!isSameProperty(left, right)) {
return false;
}
const lobj = left.object;
const robj = right.object;
if (lobj.type !== robj.type) {
return false;
}
if (lobj.type === "MemberExpression") {
return isSameMember(lobj, robj);
... | [
"function",
"isSameMember",
"(",
"left",
",",
"right",
")",
"{",
"if",
"(",
"!",
"isSameProperty",
"(",
"left",
",",
"right",
")",
")",
"{",
"return",
"false",
";",
"}",
"const",
"lobj",
"=",
"left",
".",
"object",
";",
"const",
"robj",
"=",
"right",... | Checks whether 2 given member expression nodes are the reference to the same
property or not.
@param {ASTNode} left - A member expression node to check.
@param {ASTNode} right - Another member expression node to check.
@returns {boolean} `true` if the member expressions are the reference to the
same property or not. | [
"Checks",
"whether",
"2",
"given",
"member",
"expression",
"nodes",
"are",
"the",
"reference",
"to",
"the",
"same",
"property",
"or",
"not",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-self-assign.js#L52-L67 | train | Returns true if left is the same member of right | [
30522,
3853,
26354,
14074,
4168,
21784,
1006,
2187,
1010,
2157,
1007,
1063,
2065,
1006,
999,
26354,
14074,
21572,
4842,
3723,
1006,
2187,
1010,
2157,
1007,
1007,
1063,
2709,
6270,
1025,
1065,
9530,
3367,
8840,
2497,
3501,
1027,
2187,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js | getOrFetchSchema | function getOrFetchSchema(oMetaModel, mScope, sSchema, fnLog) {
var oPromise, sUrl, aUrls, mUrls;
/**
* Include the schema (and all of its children) with namespace <code>sSchema</code> from
* the given referenced scope.
*
* @param {object} mReferencedScope
* The $metadata "JSON"
*/
function i... | javascript | function getOrFetchSchema(oMetaModel, mScope, sSchema, fnLog) {
var oPromise, sUrl, aUrls, mUrls;
/**
* Include the schema (and all of its children) with namespace <code>sSchema</code> from
* the given referenced scope.
*
* @param {object} mReferencedScope
* The $metadata "JSON"
*/
function i... | [
"function",
"getOrFetchSchema",
"(",
"oMetaModel",
",",
"mScope",
",",
"sSchema",
",",
"fnLog",
")",
"{",
"var",
"oPromise",
",",
"sUrl",
",",
"aUrls",
",",
"mUrls",
";",
"/**\n\t\t * Include the schema (and all of its children) with namespace <code>sSchema</code> from\n\t\... | Returns the schema with the given namespace, or a promise which is resolved as soon as the
schema has been included, or <code>undefined</code> in case the schema is neither present nor
referenced.
@param {sap.ui.model.odata.v4.ODataMetaModel} oMetaModel
The OData metadata model
@param {object} mScope
The $metadata "JS... | [
"Returns",
"the",
"schema",
"with",
"the",
"given",
"namespace",
"or",
"a",
"promise",
"which",
"is",
"resolved",
"as",
"soon",
"as",
"the",
"schema",
"has",
"been",
"included",
"or",
"<code",
">",
"undefined<",
"/",
"code",
">",
"in",
"case",
"the",
"sc... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js#L149-L209 | train | Returns the schema that is referenced by the given schema. | [
30522,
3853,
2131,
16347,
3388,
18069,
5403,
2863,
1006,
18168,
12928,
5302,
9247,
1010,
23794,
17635,
1010,
7020,
5403,
2863,
1010,
1042,
20554,
8649,
1007,
1063,
13075,
6728,
21716,
5562,
1010,
7505,
2140,
1010,
8740,
12190,
2015,
1010,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | bower_components/Flot/examples/axes-time-zones/date.js | function (date, type, rule) {
var offset = 0;
if (type === 'u' || type === 'g' || type === 'z') { // UTC
offset = 0;
} else if (type === 's') { // Standard Time
offset = basicOffset;
} else if (type === 'w' || !type) { // Wall Clock Time
offset = getAdjuste... | javascript | function (date, type, rule) {
var offset = 0;
if (type === 'u' || type === 'g' || type === 'z') { // UTC
offset = 0;
} else if (type === 's') { // Standard Time
offset = basicOffset;
} else if (type === 'w' || !type) { // Wall Clock Time
offset = getAdjuste... | [
"function",
"(",
"date",
",",
"type",
",",
"rule",
")",
"{",
"var",
"offset",
"=",
"0",
";",
"if",
"(",
"type",
"===",
"'u'",
"||",
"type",
"===",
"'g'",
"||",
"type",
"===",
"'z'",
")",
"{",
"// UTC",
"offset",
"=",
"0",
";",
"}",
"else",
"if"... | Convert a date to UTC. Depending on the 'type' parameter, the date parameter may be: - `u`, `g`, `z`: already UTC (no adjustment). - `s`: standard time (adjust for time zone offset but not for DST) - `w`: wall clock time (adjust for both time zone and DST offset). DST adjustment is done using the rule given as thir... | [
"Convert",
"a",
"date",
"to",
"UTC",
".",
"Depending",
"on",
"the",
"type",
"parameter",
"the",
"date",
"parameter",
"may",
"be",
":",
"-",
"u",
"g",
"z",
":",
"already",
"UTC",
"(",
"no",
"adjustment",
")",
".",
"-",
"s",
":",
"standard",
"time",
... | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/Flot/examples/axes-time-zones/date.js#L534-L549 | train | Returns the date | [
30522,
3853,
1006,
3058,
1010,
2828,
1010,
3627,
1007,
1063,
13075,
16396,
1027,
1014,
1025,
2065,
1006,
2828,
1027,
1027,
1027,
1005,
1057,
1005,
1064,
1064,
2828,
1027,
1027,
1027,
1005,
1043,
1005,
1064,
1064,
2828,
1027,
1027,
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... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/AnnotationParser.js | index | function index() {
return Array.prototype.filter.call(oElement.parentNode.childNodes, function (oNode) {
return oNode.nodeType === 1;
}).indexOf(oElement);
} | javascript | function index() {
return Array.prototype.filter.call(oElement.parentNode.childNodes, function (oNode) {
return oNode.nodeType === 1;
}).indexOf(oElement);
} | [
"function",
"index",
"(",
")",
"{",
"return",
"Array",
".",
"prototype",
".",
"filter",
".",
"call",
"(",
"oElement",
".",
"parentNode",
".",
"childNodes",
",",
"function",
"(",
"oNode",
")",
"{",
"return",
"oNode",
".",
"nodeType",
"===",
"1",
";",
"}... | returns the current oElement's index in its parentElement's "children" collection (but works in IE as well) | [
"returns",
"the",
"current",
"oElement",
"s",
"index",
"in",
"its",
"parentElement",
"s",
"children",
"collection",
"(",
"but",
"works",
"in",
"IE",
"as",
"well",
")"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/AnnotationParser.js#L442-L446 | train | Returns the index of the given element in the DOM | [
30522,
3853,
5950,
1006,
1007,
1063,
2709,
9140,
1012,
8773,
1012,
11307,
1012,
2655,
1006,
1051,
12260,
3672,
1012,
6687,
3630,
3207,
1012,
2775,
3630,
6155,
1010,
3853,
1006,
21058,
3207,
1007,
1063,
2709,
21058,
3207,
1012,
13045,
13874,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ui-element.js | UIArgument | function UIArgument(uiArgumentShorthand, localVars)
{
/**
* @param uiArgumentShorthand
*
* @throws UIArgumentException
*/
this.validate = function(uiArgumentShorthand)
{
var msg = "UIArgument validation error:\n"
+ print_r(uiArgumentShorthand);
// tr... | javascript | function UIArgument(uiArgumentShorthand, localVars)
{
/**
* @param uiArgumentShorthand
*
* @throws UIArgumentException
*/
this.validate = function(uiArgumentShorthand)
{
var msg = "UIArgument validation error:\n"
+ print_r(uiArgumentShorthand);
// tr... | [
"function",
"UIArgument",
"(",
"uiArgumentShorthand",
",",
"localVars",
")",
"{",
"/**\n * @param uiArgumentShorthand\n *\n * @throws UIArgumentException\n */",
"this",
".",
"validate",
"=",
"function",
"(",
"uiArgumentShorthand",
")",
"{",
"var",
"msg",
"=",... | Constructs a UIArgument. This is mostly for checking that the values are
valid.
@param uiArgumentShorthand
@param localVars
@throws UIArgumentException | [
"Constructs",
"a",
"UIArgument",
".",
"This",
"is",
"mostly",
"for",
"checking",
"that",
"the",
"values",
"are",
"valid",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/ui-element.js#L530-L586 | train | UIArgument constructor. | [
30522,
3853,
21318,
2906,
22850,
4765,
1006,
21318,
2906,
22850,
11187,
27794,
11774,
1010,
2334,
10755,
2015,
1007,
1063,
1013,
1008,
1008,
1008,
1030,
11498,
2213,
21318,
2906,
22850,
11187,
27794,
11774,
1008,
1008,
1030,
11618,
21318,
290... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aframevr/aframe | src/components/scene/screenshot.js | function (evt) {
var shortcutPressed = evt.keyCode === 83 && evt.ctrlKey && evt.altKey;
if (!this.data || !shortcutPressed) { return; }
var projection = evt.shiftKey ? 'equirectangular' : 'perspective';
this.capture(projection);
} | javascript | function (evt) {
var shortcutPressed = evt.keyCode === 83 && evt.ctrlKey && evt.altKey;
if (!this.data || !shortcutPressed) { return; }
var projection = evt.shiftKey ? 'equirectangular' : 'perspective';
this.capture(projection);
} | [
"function",
"(",
"evt",
")",
"{",
"var",
"shortcutPressed",
"=",
"evt",
".",
"keyCode",
"===",
"83",
"&&",
"evt",
".",
"ctrlKey",
"&&",
"evt",
".",
"altKey",
";",
"if",
"(",
"!",
"this",
".",
"data",
"||",
"!",
"shortcutPressed",
")",
"{",
"return",
... | <ctrl> + <alt> + s = Regular screenshot.
<ctrl> + <alt> + <shift> + s = Equirectangular screenshot. | [
"<ctrl",
">",
"+",
"<alt",
">",
"+",
"s",
"=",
"Regular",
"screenshot",
".",
"<ctrl",
">",
"+",
"<alt",
">",
"+",
"<shift",
">",
"+",
"s",
"=",
"Equirectangular",
"screenshot",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/scene/screenshot.js#L121-L126 | train | The event handler for the keydown event | [
30522,
3853,
1006,
23408,
2102,
1007,
1063,
13075,
2460,
12690,
19811,
1027,
23408,
2102,
1012,
3145,
16044,
1027,
1027,
1027,
6640,
1004,
1004,
23408,
2102,
1012,
14931,
12190,
14839,
1004,
1004,
23408,
2102,
1012,
12456,
14839,
1025,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/extensions/default/JavaScriptRefactoring/WrapSelection.js | convertToArrowFunction | function convertToArrowFunction() {
var editor = EditorManager.getActiveEditor();
if (!editor) {
return;
}
initializeRefactoringSession(editor);
var funcExprNode = RefactoringUtils.findSurroundASTNode(current.ast, {start: current.startIndex}, ["Function"]);
... | javascript | function convertToArrowFunction() {
var editor = EditorManager.getActiveEditor();
if (!editor) {
return;
}
initializeRefactoringSession(editor);
var funcExprNode = RefactoringUtils.findSurroundASTNode(current.ast, {start: current.startIndex}, ["Function"]);
... | [
"function",
"convertToArrowFunction",
"(",
")",
"{",
"var",
"editor",
"=",
"EditorManager",
".",
"getActiveEditor",
"(",
")",
";",
"if",
"(",
"!",
"editor",
")",
"{",
"return",
";",
"}",
"initializeRefactoringSession",
"(",
"editor",
")",
";",
"var",
"funcEx... | Convert function to arrow function | [
"Convert",
"function",
"to",
"arrow",
"function"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptRefactoring/WrapSelection.js#L122-L227 | train | Convert an arrow function to a function | [
30522,
3853,
10463,
3406,
2906,
10524,
11263,
27989,
1006,
1007,
1063,
13075,
3559,
1027,
3559,
24805,
4590,
1012,
2131,
19620,
2098,
15660,
1006,
1007,
1025,
2065,
1006,
999,
3559,
1007,
1063,
2709,
1025,
1065,
3988,
17629,
12879,
18908,
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/utils/Async.js | doInParallel_aggregateErrors | function doInParallel_aggregateErrors(items, beginProcessItem) {
var errors = [];
var masterDeferred = new $.Deferred();
var parallelResult = doInParallel(
items,
function (item, i) {
var itemResult = beginProcessItem(item, i);
itemResult... | javascript | function doInParallel_aggregateErrors(items, beginProcessItem) {
var errors = [];
var masterDeferred = new $.Deferred();
var parallelResult = doInParallel(
items,
function (item, i) {
var itemResult = beginProcessItem(item, i);
itemResult... | [
"function",
"doInParallel_aggregateErrors",
"(",
"items",
",",
"beginProcessItem",
")",
"{",
"var",
"errors",
"=",
"[",
"]",
";",
"var",
"masterDeferred",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"var",
"parallelResult",
"=",
"doInParallel",
"(",
"it... | Executes a series of tasks in parallel, saving up error info from any that fail along the way.
Returns a Promise that is only resolved/rejected once all tasks are complete. This is
essentially a wrapper around doInParallel(..., false).
If one or more tasks failed, the entire "master" promise is rejected at the end - w... | [
"Executes",
"a",
"series",
"of",
"tasks",
"in",
"parallel",
"saving",
"up",
"error",
"info",
"from",
"any",
"that",
"fail",
"along",
"the",
"way",
".",
"Returns",
"a",
"Promise",
"that",
"is",
"only",
"resolved",
"/",
"rejected",
"once",
"all",
"tasks",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/Async.js#L283-L309 | train | Aggregate all errors in parallel | [
30522,
3853,
24341,
28689,
6216,
2140,
1035,
9572,
2121,
29165,
2015,
1006,
5167,
1010,
4088,
21572,
9623,
28032,
6633,
1007,
1063,
13075,
10697,
1027,
1031,
1033,
1025,
13075,
3040,
3207,
7512,
5596,
1027,
2047,
1002,
1012,
13366,
28849,
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... |
firebase/firebaseui-web | demo/public/app.js | getUiConfig | function getUiConfig() {
return {
'callbacks': {
// Called when the user has been successfully signed in.
'signInSuccessWithAuthResult': function(authResult, redirectUrl) {
if (authResult.user) {
handleSignedInUser(authResult.user);
}
if (authResult.additionalUserInfo... | javascript | function getUiConfig() {
return {
'callbacks': {
// Called when the user has been successfully signed in.
'signInSuccessWithAuthResult': function(authResult, redirectUrl) {
if (authResult.user) {
handleSignedInUser(authResult.user);
}
if (authResult.additionalUserInfo... | [
"function",
"getUiConfig",
"(",
")",
"{",
"return",
"{",
"'callbacks'",
":",
"{",
"// Called when the user has been successfully signed in.",
"'signInSuccessWithAuthResult'",
":",
"function",
"(",
"authResult",
",",
"redirectUrl",
")",
"{",
"if",
"(",
"authResult",
".",... | FirebaseUI initialization to be used in a Single Page application context.
@return {!Object} The FirebaseUI config. | [
"FirebaseUI",
"initialization",
"to",
"be",
"used",
"in",
"a",
"Single",
"Page",
"application",
"context",
"."
] | c10aa51e38aeb38dc63baa22b48cd6690c2be087 | https://github.com/firebase/firebaseui-web/blob/c10aa51e38aeb38dc63baa22b48cd6690c2be087/demo/public/app.js#L22-L90 | train | Returns the UI configuration for the AuthProvider. | [
30522,
3853,
2131,
10179,
8663,
8873,
2290,
1006,
1007,
1063,
2709,
1063,
1005,
2655,
12221,
1005,
1024,
1063,
1013,
1013,
2170,
2043,
1996,
5310,
2038,
2042,
5147,
2772,
1999,
1012,
1005,
3696,
7076,
14194,
9623,
26760,
26054,
14317,
6072,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/docker-prompts.js | askForServiceDiscovery | function askForServiceDiscovery() {
if (this.regenerate) return;
const done = this.async();
const serviceDiscoveryEnabledApps = [];
this.appConfigs.forEach((appConfig, index) => {
if (appConfig.serviceDiscoveryType) {
serviceDiscoveryEnabledApps.push({
baseName: app... | javascript | function askForServiceDiscovery() {
if (this.regenerate) return;
const done = this.async();
const serviceDiscoveryEnabledApps = [];
this.appConfigs.forEach((appConfig, index) => {
if (appConfig.serviceDiscoveryType) {
serviceDiscoveryEnabledApps.push({
baseName: app... | [
"function",
"askForServiceDiscovery",
"(",
")",
"{",
"if",
"(",
"this",
".",
"regenerate",
")",
"return",
";",
"const",
"done",
"=",
"this",
".",
"async",
"(",
")",
";",
"const",
"serviceDiscoveryEnabledApps",
"=",
"[",
"]",
";",
"this",
".",
"appConfigs",... | Ask For Service Discovery | [
"Ask",
"For",
"Service",
"Discovery"
] | f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff | https://github.com/jhipster/generator-jhipster/blob/f76fa8de0818ce6bda6c7b1455942e2a9b0ae3ff/generators/docker-prompts.js#L307-L371 | train | Ask For Service Discovery | [
30522,
3853,
3198,
29278,
8043,
7903,
2098,
2483,
3597,
27900,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
19723,
24454,
3686,
1007,
2709,
1025,
9530,
3367,
2589,
1027,
2023,
1012,
2004,
6038,
2278,
1006,
1007,
1025,
9530,
3367,
22858,
2483,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Core.js | preprocessDependencies | function preprocessDependencies(dependencies) {
if (Array.isArray(dependencies)) {
// remove .library-preload suffix from dependencies
return dependencies.map(function (dep) {
return dep.replace(/\.library-preload$/, '');
});
}
return dependencies;
} | javascript | function preprocessDependencies(dependencies) {
if (Array.isArray(dependencies)) {
// remove .library-preload suffix from dependencies
return dependencies.map(function (dep) {
return dep.replace(/\.library-preload$/, '');
});
}
return dependencies;
} | [
"function",
"preprocessDependencies",
"(",
"dependencies",
")",
"{",
"if",
"(",
"Array",
".",
"isArray",
"(",
"dependencies",
")",
")",
"{",
"// remove .library-preload suffix from dependencies",
"return",
"dependencies",
".",
"map",
"(",
"function",
"(",
"dep",
")"... | Preprocessed given dependencies
@param {object} oDependencies - Dependencies to preprocess
@returns {object} oDependencies - Proprocessed dependencies | [
"Preprocessed",
"given",
"dependencies"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Core.js#L1736-L1744 | train | Preprocess the dependencies array | [
30522,
3853,
17463,
3217,
9623,
16150,
13699,
10497,
15266,
1006,
12530,
15266,
1007,
1063,
2065,
1006,
9140,
1012,
18061,
11335,
2100,
1006,
12530,
15266,
1007,
1007,
1063,
1013,
1013,
6366,
1012,
3075,
1011,
3653,
11066,
16809,
2013,
12530,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/core/util/util.js | function(element, scrollEnd, duration) {
var scrollStart = element.scrollTop;
var scrollChange = scrollEnd - scrollStart;
var scrollingDown = scrollStart < scrollEnd;
var startTime = $mdUtil.now();
$$rAF(scrollChunk);
function scrollChunk() {
var newPosition = calculateNewP... | javascript | function(element, scrollEnd, duration) {
var scrollStart = element.scrollTop;
var scrollChange = scrollEnd - scrollStart;
var scrollingDown = scrollStart < scrollEnd;
var startTime = $mdUtil.now();
$$rAF(scrollChunk);
function scrollChunk() {
var newPosition = calculateNewP... | [
"function",
"(",
"element",
",",
"scrollEnd",
",",
"duration",
")",
"{",
"var",
"scrollStart",
"=",
"element",
".",
"scrollTop",
";",
"var",
"scrollChange",
"=",
"scrollEnd",
"-",
"scrollStart",
";",
"var",
"scrollingDown",
"=",
"scrollStart",
"<",
"scrollEnd"... | Animate the requested element's scrollTop to the requested scrollPosition with basic easing.
@param {!Element} element The element to scroll.
@param {number} scrollEnd The new/final scroll position.
@param {number=} duration Duration of the scroll. Default is 1000ms. | [
"Animate",
"the",
"requested",
"element",
"s",
"scrollTop",
"to",
"the",
"requested",
"scrollPosition",
"with",
"basic",
"easing",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L817-L854 | train | Scrolls the element to the specified position. | [
30522,
3853,
1006,
5783,
1010,
17186,
10497,
1010,
9367,
1007,
1063,
13075,
23074,
7559,
2102,
1027,
5783,
1012,
17186,
14399,
1025,
13075,
17186,
22305,
2063,
1027,
17186,
10497,
1011,
23074,
7559,
2102,
1025,
13075,
28903,
7698,
1027,
23074... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
eslint/eslint | lib/rules/no-irregular-whitespace.js | checkForIrregularWhitespace | function checkForIrregularWhitespace(node) {
const sourceLines = sourceCode.lines;
sourceLines.forEach((sourceLine, lineIndex) => {
const lineNumber = lineIndex + 1;
let match;
while ((match = IRREGULAR_WHITESPACE.exec(sourceLine)) !== null) {
... | javascript | function checkForIrregularWhitespace(node) {
const sourceLines = sourceCode.lines;
sourceLines.forEach((sourceLine, lineIndex) => {
const lineNumber = lineIndex + 1;
let match;
while ((match = IRREGULAR_WHITESPACE.exec(sourceLine)) !== null) {
... | [
"function",
"checkForIrregularWhitespace",
"(",
"node",
")",
"{",
"const",
"sourceLines",
"=",
"sourceCode",
".",
"lines",
";",
"sourceLines",
".",
"forEach",
"(",
"(",
"sourceLine",
",",
"lineIndex",
")",
"=>",
"{",
"const",
"lineNumber",
"=",
"lineIndex",
"+... | Checks the program source for irregular whitespace
@param {ASTNode} node The program node
@returns {void}
@private | [
"Checks",
"the",
"program",
"source",
"for",
"irregular",
"whitespace"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-irregular-whitespace.js#L151-L167 | train | Check if node has irregular whitespace | [
30522,
3853,
4638,
29278,
4313,
2890,
24848,
2906,
2860,
16584,
2229,
15327,
1006,
13045,
1007,
1063,
9530,
3367,
3120,
12735,
1027,
3120,
16044,
1012,
3210,
1025,
3120,
12735,
1012,
18921,
6776,
1006,
1006,
3120,
4179,
1010,
2240,
22254,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/util/reflection/BaseTreeModifier.js | function(oControl) {
var sControlType = this._getControlTypeInXml(oControl);
jQuery.sap.require(sControlType);
var ControlType = ObjectPath.get(sControlType);
return ControlType.getMetadata();
} | javascript | function(oControl) {
var sControlType = this._getControlTypeInXml(oControl);
jQuery.sap.require(sControlType);
var ControlType = ObjectPath.get(sControlType);
return ControlType.getMetadata();
} | [
"function",
"(",
"oControl",
")",
"{",
"var",
"sControlType",
"=",
"this",
".",
"_getControlTypeInXml",
"(",
"oControl",
")",
";",
"jQuery",
".",
"sap",
".",
"require",
"(",
"sControlType",
")",
";",
"var",
"ControlType",
"=",
"ObjectPath",
".",
"get",
"("... | Gets the metadata of am XML control.
@param {Element} oControl - Control in XML
@returns {sap.ui.base.Metadata} Metadata of the control | [
"Gets",
"the",
"metadata",
"of",
"am",
"XML",
"control",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/reflection/BaseTreeModifier.js#L293-L298 | train | Returns the metadata of the control. | [
30522,
3853,
1006,
1051,
8663,
13181,
2140,
1007,
1063,
13075,
8040,
12162,
13153,
13874,
1027,
2023,
1012,
1035,
2131,
8663,
13181,
24228,
5051,
2378,
2595,
19968,
1006,
1051,
8663,
13181,
2140,
1007,
1025,
1046,
4226,
2854,
1012,
20066,
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/thirdparty/blanket.js | parsePrimaryExpression | function parsePrimaryExpression() {
var type, token, expr, startToken;
if (match('(')) {
return parseGroupExpression();
}
if (match('[')) {
return parseArrayInitialiser();
}
if (match('{')) {
return parseObjectInitialiser();
... | javascript | function parsePrimaryExpression() {
var type, token, expr, startToken;
if (match('(')) {
return parseGroupExpression();
}
if (match('[')) {
return parseArrayInitialiser();
}
if (match('{')) {
return parseObjectInitialiser();
... | [
"function",
"parsePrimaryExpression",
"(",
")",
"{",
"var",
"type",
",",
"token",
",",
"expr",
",",
"startToken",
";",
"if",
"(",
"match",
"(",
"'('",
")",
")",
"{",
"return",
"parseGroupExpression",
"(",
")",
";",
"}",
"if",
"(",
"match",
"(",
"'['",
... | 11.1 Primary Expressions | [
"11",
".",
"1",
"Primary",
"Expressions"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/blanket.js#L2151-L2206 | train | ECMA - 262 12. 2 Primary Expressions | [
30522,
3853,
11968,
3366,
18098,
9581,
2854,
10288,
20110,
3258,
1006,
1007,
1063,
13075,
2828,
1010,
19204,
1010,
4654,
18098,
1010,
2707,
18715,
2368,
1025,
2065,
1006,
2674,
1006,
1005,
1006,
1005,
1007,
1007,
1063,
2709,
11968,
3366,
17... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laurent22/joplin | Clipper/joplin-webclipper/content_scripts/Readability.js | function(nodeList, filterFn) {
for (var i = nodeList.length - 1; i >= 0; i--) {
var node = nodeList[i];
var parentNode = node.parentNode;
if (parentNode) {
if (!filterFn || filterFn.call(this, node, i, nodeList)) {
parentNode.removeChild(node);
}
}
}
} | javascript | function(nodeList, filterFn) {
for (var i = nodeList.length - 1; i >= 0; i--) {
var node = nodeList[i];
var parentNode = node.parentNode;
if (parentNode) {
if (!filterFn || filterFn.call(this, node, i, nodeList)) {
parentNode.removeChild(node);
}
}
}
} | [
"function",
"(",
"nodeList",
",",
"filterFn",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"nodeList",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"var",
"node",
"=",
"nodeList",
"[",
"i",
"]",
";",
"var",
"parentNode",
"=... | Iterates over a NodeList, calls `filterFn` for each node and removes node
if function returned `true`.
If function is not passed, removes all the nodes in node list.
@param NodeList nodeList The nodes to operate on
@param Function filterFn the function to use as a filter
@return void | [
"Iterates",
"over",
"a",
"NodeList",
"calls",
"filterFn",
"for",
"each",
"node",
"and",
"removes",
"node",
"if",
"function",
"returned",
"true",
"."
] | beb428b246cecba4630a3ca57b472f43c0933a43 | https://github.com/laurent22/joplin/blob/beb428b246cecba4630a3ca57b472f43c0933a43/Clipper/joplin-webclipper/content_scripts/Readability.js#L175-L185 | train | Remove all nodes in the list | [
30522,
3853,
1006,
13045,
9863,
1010,
11307,
2546,
2078,
1007,
1063,
2005,
1006,
13075,
1045,
1027,
13045,
9863,
1012,
3091,
1011,
1015,
1025,
1045,
1028,
1027,
1014,
1025,
1045,
1011,
1011,
1007,
1063,
13075,
13045,
1027,
13045,
9863,
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... | |
nhn/tui.editor | src/js/wwTableManager.js | tableCellGenerator | function tableCellGenerator(amount, tagName) {
const brHTMLString = '<br />';
const cellString = `<${tagName}>${brHTMLString}</${tagName}>`;
let tdString = '';
for (let i = 0; i < amount; i += 1) {
tdString = tdString + cellString;
}
return tdString;
} | javascript | function tableCellGenerator(amount, tagName) {
const brHTMLString = '<br />';
const cellString = `<${tagName}>${brHTMLString}</${tagName}>`;
let tdString = '';
for (let i = 0; i < amount; i += 1) {
tdString = tdString + cellString;
}
return tdString;
} | [
"function",
"tableCellGenerator",
"(",
"amount",
",",
"tagName",
")",
"{",
"const",
"brHTMLString",
"=",
"'<br />'",
";",
"const",
"cellString",
"=",
"`",
"${",
"tagName",
"}",
"${",
"brHTMLString",
"}",
"${",
"tagName",
"}",
"`",
";",
"let",
"tdString",
"... | Generate table cell HTML text
@param {number} amount Amount of cells
@param {string} tagName Tag name of cell 'td' or 'th'
@private
@returns {string} | [
"Generate",
"table",
"cell",
"HTML",
"text"
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/wwTableManager.js#L1274-L1284 | train | Generate table cell | [
30522,
3853,
2795,
29109,
28875,
3678,
8844,
1006,
3815,
1010,
6415,
18442,
1007,
1063,
9530,
3367,
7987,
11039,
19968,
3367,
4892,
1027,
1005,
1026,
7987,
1013,
1028,
1005,
1025,
9530,
3367,
4442,
18886,
3070,
1027,
1036,
1026,
1002,
1063,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
lovell/sharp | lib/resize.js | extend | function extend (extend) {
if (is.integer(extend) && extend > 0) {
this.options.extendTop = extend;
this.options.extendBottom = extend;
this.options.extendLeft = extend;
this.options.extendRight = extend;
} else if (
is.object(extend) &&
is.integer(extend.top) && extend.top >= 0 &&
is.in... | javascript | function extend (extend) {
if (is.integer(extend) && extend > 0) {
this.options.extendTop = extend;
this.options.extendBottom = extend;
this.options.extendLeft = extend;
this.options.extendRight = extend;
} else if (
is.object(extend) &&
is.integer(extend.top) && extend.top >= 0 &&
is.in... | [
"function",
"extend",
"(",
"extend",
")",
"{",
"if",
"(",
"is",
".",
"integer",
"(",
"extend",
")",
"&&",
"extend",
">",
"0",
")",
"{",
"this",
".",
"options",
".",
"extendTop",
"=",
"extend",
";",
"this",
".",
"options",
".",
"extendBottom",
"=",
... | Extends/pads the edges of the image with the provided background colour.
This operation will always occur after resizing and extraction, if any.
@example
// Resize to 140 pixels wide, then add 10 transparent pixels
// to the top, left and right edges and 20 to the bottom edge
sharp(input)
.resize(140)
.extend({
top: 1... | [
"Extends",
"/",
"pads",
"the",
"edges",
"of",
"the",
"image",
"with",
"the",
"provided",
"background",
"colour",
".",
"This",
"operation",
"will",
"always",
"occur",
"after",
"resizing",
"and",
"extraction",
"if",
"any",
"."
] | 05d76eeadfe54713606a615185b2da047923406b | https://github.com/lovell/sharp/blob/05d76eeadfe54713606a615185b2da047923406b/lib/resize.js#L291-L313 | train | Extend the edge container | [
30522,
3853,
7949,
1006,
7949,
1007,
1063,
2065,
1006,
2003,
1012,
16109,
1006,
7949,
1007,
1004,
1004,
7949,
1028,
1014,
1007,
1063,
2023,
1012,
7047,
1012,
7949,
14399,
1027,
7949,
1025,
2023,
1012,
7047,
1012,
7949,
18384,
20389,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/select/select.js | calculateMenuPositions | function calculateMenuPositions(scope, element, opts) {
var
containerNode = element[0],
targetNode = opts.target[0].children[0], // target the label
parentNode = $document[0].body,
selectNode = opts.selectEl[0],
contentNode = opts.contentEl[0],
parentRect = parentNo... | javascript | function calculateMenuPositions(scope, element, opts) {
var
containerNode = element[0],
targetNode = opts.target[0].children[0], // target the label
parentNode = $document[0].body,
selectNode = opts.selectEl[0],
contentNode = opts.contentEl[0],
parentRect = parentNo... | [
"function",
"calculateMenuPositions",
"(",
"scope",
",",
"element",
",",
"opts",
")",
"{",
"var",
"containerNode",
"=",
"element",
"[",
"0",
"]",
",",
"targetNode",
"=",
"opts",
".",
"target",
"[",
"0",
"]",
".",
"children",
"[",
"0",
"]",
",",
"// tar... | Calculate the | [
"Calculate",
"the"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/select/select.js#L1628-L1773 | train | Calculate the position of the menu | [
30522,
3853,
18422,
3549,
6279,
19234,
2015,
1006,
9531,
1010,
5783,
1010,
23569,
2015,
1007,
1063,
13075,
11661,
3630,
3207,
1027,
5783,
1031,
1014,
1033,
1010,
4539,
3630,
3207,
1027,
23569,
2015,
1012,
4539,
1031,
1014,
1033,
1012,
2336,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Dogfalo/materialize | extras/noUiSlider/nouislider.js | toStepping | function toStepping ( xVal, xPct, value ) {
if ( value >= xVal.slice(-1)[0] ){
return 100;
}
var j = getJ( value, xVal ), va, vb, pa, pb;
va = xVal[j-1];
vb = xVal[j];
pa = xPct[j-1];
pb = xPct[j];
return pa + (toPercentage([va, vb], value)... | javascript | function toStepping ( xVal, xPct, value ) {
if ( value >= xVal.slice(-1)[0] ){
return 100;
}
var j = getJ( value, xVal ), va, vb, pa, pb;
va = xVal[j-1];
vb = xVal[j];
pa = xPct[j-1];
pb = xPct[j];
return pa + (toPercentage([va, vb], value)... | [
"function",
"toStepping",
"(",
"xVal",
",",
"xPct",
",",
"value",
")",
"{",
"if",
"(",
"value",
">=",
"xVal",
".",
"slice",
"(",
"-",
"1",
")",
"[",
"0",
"]",
")",
"{",
"return",
"100",
";",
"}",
"var",
"j",
"=",
"getJ",
"(",
"value",
",",
"x... | (percentage) Input a value, find where, on a scale of 0-100, it applies. | [
"(",
"percentage",
")",
"Input",
"a",
"value",
"find",
"where",
"on",
"a",
"scale",
"of",
"0",
"-",
"100",
"it",
"applies",
"."
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/extras/noUiSlider/nouislider.js#L208-L222 | train | returns the stepping value | [
30522,
3853,
2000,
13473,
14853,
1006,
15566,
2389,
1010,
26726,
6593,
1010,
3643,
1007,
1063,
2065,
1006,
3643,
1028,
1027,
15566,
2389,
1012,
14704,
1006,
1011,
1015,
1007,
1031,
1014,
1033,
1007,
1063,
2709,
2531,
1025,
1065,
13075,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/routing/Target.js | function () {
this._oParent = null;
this._oOptions = null;
this._oCache = null;
if (this._oTitleProvider) {
this._oTitleProvider.destroy();
}
this._oTitleProvider = null;
EventProvider.prototype.destroy.apply(this, arguments);
this.bIsDestroyed = true;
return this;
} | javascript | function () {
this._oParent = null;
this._oOptions = null;
this._oCache = null;
if (this._oTitleProvider) {
this._oTitleProvider.destroy();
}
this._oTitleProvider = null;
EventProvider.prototype.destroy.apply(this, arguments);
this.bIsDestroyed = true;
return this;
} | [
"function",
"(",
")",
"{",
"this",
".",
"_oParent",
"=",
"null",
";",
"this",
".",
"_oOptions",
"=",
"null",
";",
"this",
".",
"_oCache",
"=",
"null",
";",
"if",
"(",
"this",
".",
"_oTitleProvider",
")",
"{",
"this",
".",
"_oTitleProvider",
".",
"des... | Destroys the target, will be called by {@link sap.m.routing.Targets} don't call this directly.
@protected
@returns { sap.ui.core.routing.Target } this for chaining. | [
"Destroys",
"the",
"target",
"will",
"be",
"called",
"by",
"{",
"@link",
"sap",
".",
"m",
".",
"routing",
".",
"Targets",
"}",
"don",
"t",
"call",
"this",
"directly",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/routing/Target.js#L91-L103 | train | Destroys the object | [
30522,
3853,
1006,
1007,
1063,
2023,
1012,
1035,
6728,
12069,
3372,
1027,
19701,
1025,
2023,
1012,
1035,
1051,
7361,
9285,
1027,
19701,
1025,
2023,
1012,
1035,
1051,
3540,
5403,
1027,
19701,
1025,
2065,
1006,
2023,
1012,
1035,
27178,
4183,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.commons/src/sap/ui/commons/layout/AbsoluteLayoutRenderer.js | function(oPosition) {
var oPos = oPosition.getComputedPosition();
var addStyle = function(oPosition, aBuffer, sPos, sVal){
if (sVal) {
aBuffer.push(sPos + ":" + sVal + ";");
}
};
var aBuffer = [];
addStyle(oPosition, aBuffer, "top", oPos.top);
addStyle(oPosition, aBuffer, "bottom", oPos.bottom);... | javascript | function(oPosition) {
var oPos = oPosition.getComputedPosition();
var addStyle = function(oPosition, aBuffer, sPos, sVal){
if (sVal) {
aBuffer.push(sPos + ":" + sVal + ";");
}
};
var aBuffer = [];
addStyle(oPosition, aBuffer, "top", oPos.top);
addStyle(oPosition, aBuffer, "bottom", oPos.bottom);... | [
"function",
"(",
"oPosition",
")",
"{",
"var",
"oPos",
"=",
"oPosition",
".",
"getComputedPosition",
"(",
")",
";",
"var",
"addStyle",
"=",
"function",
"(",
"oPosition",
",",
"aBuffer",
",",
"sPos",
",",
"sVal",
")",
"{",
"if",
"(",
"sVal",
")",
"{",
... | Computes and returns the CSS styles for the given position.
@private | [
"Computes",
"and",
"returns",
"the",
"CSS",
"styles",
"for",
"the",
"given",
"position",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/layout/AbsoluteLayoutRenderer.js#L173-L191 | train | Adds the position style to the buffer | [
30522,
3853,
1006,
6728,
19234,
1007,
1063,
13075,
6728,
2891,
1027,
6728,
19234,
1012,
2131,
9006,
29462,
26994,
1006,
1007,
1025,
13075,
9909,
27983,
1027,
3853,
1006,
6728,
19234,
1010,
8273,
12494,
1010,
11867,
2891,
1010,
17917,
2389,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
jgraph/mxgraph | javascript/mxClient.js | function (x0, y0, x1, y1, x2, y2, x3, y3)
{
var denom = ((y3 - y2) * (x1 - x0)) - ((x3 - x2) * (y1 - y0));
var nume_a = ((x3 - x2) * (y0 - y2)) - ((y3 - y2) * (x0 - x2));
var nume_b = ((x1 - x0) * (y0 - y2)) - ((y1 - y0) * (x0 - x2));
var ua = nume_a / denom;
var ub = nume_b / denom;
if(ua >= 0.0 && ua... | javascript | function (x0, y0, x1, y1, x2, y2, x3, y3)
{
var denom = ((y3 - y2) * (x1 - x0)) - ((x3 - x2) * (y1 - y0));
var nume_a = ((x3 - x2) * (y0 - y2)) - ((y3 - y2) * (x0 - x2));
var nume_b = ((x1 - x0) * (y0 - y2)) - ((y1 - y0) * (x0 - x2));
var ua = nume_a / denom;
var ub = nume_b / denom;
if(ua >= 0.0 && ua... | [
"function",
"(",
"x0",
",",
"y0",
",",
"x1",
",",
"y1",
",",
"x2",
",",
"y2",
",",
"x3",
",",
"y3",
")",
"{",
"var",
"denom",
"=",
"(",
"(",
"y3",
"-",
"y2",
")",
"*",
"(",
"x1",
"-",
"x0",
")",
")",
"-",
"(",
"(",
"x3",
"-",
"x2",
")... | Function: intersection
Returns the intersection of two lines as an <mxPoint>.
Parameters:
x0 - X-coordinate of the first line's startpoint.
y0 - X-coordinate of the first line's startpoint.
x1 - X-coordinate of the first line's endpoint.
y1 - Y-coordinate of the first line's endpoint.
x2 - X-coordinate of the second... | [
"Function",
":",
"intersection"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L5015-L5035 | train | Returns the intersection point of two points | [
30522,
3853,
1006,
1060,
2692,
1010,
1061,
2692,
1010,
1060,
2487,
1010,
1061,
2487,
1010,
1060,
2475,
1010,
1061,
2475,
1010,
1060,
2509,
1010,
1061,
2509,
1007,
1063,
13075,
7939,
5358,
1027,
1006,
1006,
1061,
2509,
1011,
1061,
2475,
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... | |
summernote/summernote | src/js/base/core/lists.js | all | function all(array, pred) {
for (let idx = 0, len = array.length; idx < len; idx++) {
if (!pred(array[idx])) {
return false;
}
}
return true;
} | javascript | function all(array, pred) {
for (let idx = 0, len = array.length; idx < len; idx++) {
if (!pred(array[idx])) {
return false;
}
}
return true;
} | [
"function",
"all",
"(",
"array",
",",
"pred",
")",
"{",
"for",
"(",
"let",
"idx",
"=",
"0",
",",
"len",
"=",
"array",
".",
"length",
";",
"idx",
"<",
"len",
";",
"idx",
"++",
")",
"{",
"if",
"(",
"!",
"pred",
"(",
"array",
"[",
"idx",
"]",
... | returns true if all of the values in the array pass the predicate truth test. | [
"returns",
"true",
"if",
"all",
"of",
"the",
"values",
"in",
"the",
"array",
"pass",
"the",
"predicate",
"truth",
"test",
"."
] | 8dcafb8107453006b905ef697a529c42e76beb3f | https://github.com/summernote/summernote/blob/8dcafb8107453006b905ef697a529c42e76beb3f/src/js/base/core/lists.js#L54-L61 | train | Returns true if all elements in array are true | [
30522,
3853,
2035,
1006,
9140,
1010,
3653,
2094,
1007,
1063,
2005,
1006,
2292,
8909,
2595,
1027,
1014,
1010,
18798,
1027,
9140,
1012,
3091,
1025,
8909,
2595,
1026,
18798,
1025,
8909,
2595,
1009,
1009,
1007,
1063,
2065,
1006,
999,
3653,
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... |
adobe/brackets | src/editor/CodeHintList.js | _itemsPerPage | function _itemsPerPage() {
var itemsPerPage = 1,
$items = self.$hintMenu.find("li"),
$view = self.$hintMenu.find("ul.dropdown-menu"),
itemHeight;
if ($items.length !== 0) {
itemHeight = $($items[0]).height();
if (it... | javascript | function _itemsPerPage() {
var itemsPerPage = 1,
$items = self.$hintMenu.find("li"),
$view = self.$hintMenu.find("ul.dropdown-menu"),
itemHeight;
if ($items.length !== 0) {
itemHeight = $($items[0]).height();
if (it... | [
"function",
"_itemsPerPage",
"(",
")",
"{",
"var",
"itemsPerPage",
"=",
"1",
",",
"$items",
"=",
"self",
".",
"$hintMenu",
".",
"find",
"(",
"\"li\"",
")",
",",
"$view",
"=",
"self",
".",
"$hintMenu",
".",
"find",
"(",
"\"ul.dropdown-menu\"",
")",
",",
... | Calculate the number of items per scroll page. | [
"Calculate",
"the",
"number",
"of",
"items",
"per",
"scroll",
"page",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/CodeHintList.js#L389-L405 | train | Get items per page | [
30522,
3853,
1035,
5167,
4842,
13704,
1006,
1007,
1063,
13075,
5167,
4842,
13704,
1027,
1015,
1010,
1002,
5167,
1027,
2969,
1012,
1002,
9374,
3549,
2226,
1012,
2424,
1006,
1000,
5622,
1000,
1007,
1010,
1002,
3193,
1027,
2969,
1012,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/JSUtils/Session.js | Session | function Session(editor) {
this.editor = editor;
this.path = editor.document.file.fullPath;
this.ternHints = [];
this.ternGuesses = null;
this.fnType = null;
this.builtins = null;
} | javascript | function Session(editor) {
this.editor = editor;
this.path = editor.document.file.fullPath;
this.ternHints = [];
this.ternGuesses = null;
this.fnType = null;
this.builtins = null;
} | [
"function",
"Session",
"(",
"editor",
")",
"{",
"this",
".",
"editor",
"=",
"editor",
";",
"this",
".",
"path",
"=",
"editor",
".",
"document",
".",
"file",
".",
"fullPath",
";",
"this",
".",
"ternHints",
"=",
"[",
"]",
";",
"this",
".",
"ternGuesses... | Session objects encapsulate state associated with a hinting session
and provide methods for updating and querying the session.
@constructor
@param {Editor} editor - the editor context for the session | [
"Session",
"objects",
"encapsulate",
"state",
"associated",
"with",
"a",
"hinting",
"session",
"and",
"provide",
"methods",
"for",
"updating",
"and",
"querying",
"the",
"session",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/Session.js#L45-L52 | train | Session constructor. | [
30522,
3853,
5219,
1006,
3559,
1007,
1063,
2023,
1012,
3559,
1027,
3559,
1025,
2023,
1012,
4130,
1027,
3559,
1012,
6254,
1012,
5371,
1012,
2440,
15069,
1025,
2023,
1012,
28774,
25311,
18447,
2015,
1027,
1031,
1033,
1025,
2023,
1012,
28774,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/xpath/util.js | copyArrayIgnoringAttributesWithoutValue | function copyArrayIgnoringAttributesWithoutValue(dst, src)
{
if (!src) return;
for (var i = src.length - 1; i >= 0; --i) {
// this test will pass so long as the attribute has a non-empty string
// value, even if that value is "false", "0", "undefined", etc.
if (src[i].nodeValue) {
dst.push(src[i])... | javascript | function copyArrayIgnoringAttributesWithoutValue(dst, src)
{
if (!src) return;
for (var i = src.length - 1; i >= 0; --i) {
// this test will pass so long as the attribute has a non-empty string
// value, even if that value is "false", "0", "undefined", etc.
if (src[i].nodeValue) {
dst.push(src[i])... | [
"function",
"copyArrayIgnoringAttributesWithoutValue",
"(",
"dst",
",",
"src",
")",
"{",
"if",
"(",
"!",
"src",
")",
"return",
";",
"for",
"(",
"var",
"i",
"=",
"src",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"--",
"i",
")",
"{",
"// this... | This is an optimization for copying attribute lists in IE. IE includes many
extraneous properties in its DOM attribute lists, which take require
significant extra processing when evaluating attribute steps. With this
function, we ignore any such attributes that has an empty string value. | [
"This",
"is",
"an",
"optimization",
"for",
"copying",
"attribute",
"lists",
"in",
"IE",
".",
"IE",
"includes",
"many",
"extraneous",
"properties",
"in",
"its",
"DOM",
"attribute",
"lists",
"which",
"take",
"require",
"significant",
"extra",
"processing",
"when",... | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/xpath/util.js#L235-L245 | train | copy array without value | [
30522,
3853,
6100,
2906,
9447,
23773,
28741,
20697,
18886,
8569,
4570,
24415,
5833,
10175,
5657,
1006,
16233,
2102,
1010,
5034,
2278,
1007,
1063,
2065,
1006,
999,
5034,
2278,
1007,
2709,
1025,
2005,
1006,
13075,
1045,
1027,
5034,
2278,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.fl/src/sap/ui/fl/FlexController.js | function (sComponentName, sAppVersion) {
this._oChangePersistence = undefined;
this._sComponentName = sComponentName || "";
this._sAppVersion = sAppVersion || Utils.DEFAULT_APP_VERSION;
if (this._sComponentName && this._sAppVersion) {
this._createChangePersistence();
}
} | javascript | function (sComponentName, sAppVersion) {
this._oChangePersistence = undefined;
this._sComponentName = sComponentName || "";
this._sAppVersion = sAppVersion || Utils.DEFAULT_APP_VERSION;
if (this._sComponentName && this._sAppVersion) {
this._createChangePersistence();
}
} | [
"function",
"(",
"sComponentName",
",",
"sAppVersion",
")",
"{",
"this",
".",
"_oChangePersistence",
"=",
"undefined",
";",
"this",
".",
"_sComponentName",
"=",
"sComponentName",
"||",
"\"\"",
";",
"this",
".",
"_sAppVersion",
"=",
"sAppVersion",
"||",
"Utils",
... | Retrieves changes (LabelChange, etc.) for an sap.ui.core.mvc.View and applies these changes
@param {string} sComponentName - Component name the flexibility controller is responsible for
@param {string} sAppVersion - Current version of the application
@constructor
@class
@alias sap.ui.fl.FlexController
@experimental Si... | [
"Retrieves",
"changes",
"(",
"LabelChange",
"etc",
".",
")",
"for",
"an",
"sap",
".",
"ui",
".",
"core",
".",
"mvc",
".",
"View",
"and",
"applies",
"these",
"changes"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/FlexController.js#L46-L53 | train | Creates a change persistence instance | [
30522,
3853,
1006,
8040,
25377,
5643,
3372,
18442,
1010,
20066,
2361,
27774,
1007,
1063,
2023,
1012,
1035,
28166,
22043,
7347,
27870,
5897,
1027,
6151,
28344,
1025,
2023,
1012,
1035,
8040,
25377,
5643,
3372,
18442,
1027,
8040,
25377,
5643,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/date/Buddhist.js | toGregorian | function toGregorian(oBuddhist) {
var iEraStartYear = UniversalDate.getEraStartDate(CalendarType.Buddhist, 0).year,
iYear = oBuddhist.year + iEraStartYear - 1;
// Before 1941 new year started on 1st of April
if (iYear < 1941 && oBuddhist.month < 3) {
iYear += 1;
}
if (oBuddhist.year === null) {
iYear... | javascript | function toGregorian(oBuddhist) {
var iEraStartYear = UniversalDate.getEraStartDate(CalendarType.Buddhist, 0).year,
iYear = oBuddhist.year + iEraStartYear - 1;
// Before 1941 new year started on 1st of April
if (iYear < 1941 && oBuddhist.month < 3) {
iYear += 1;
}
if (oBuddhist.year === null) {
iYear... | [
"function",
"toGregorian",
"(",
"oBuddhist",
")",
"{",
"var",
"iEraStartYear",
"=",
"UniversalDate",
".",
"getEraStartDate",
"(",
"CalendarType",
".",
"Buddhist",
",",
"0",
")",
".",
"year",
",",
"iYear",
"=",
"oBuddhist",
".",
"year",
"+",
"iEraStartYear",
... | Calculate gregorian year from Buddhist year and month
@param {object} oBuddhist
@return {int} | [
"Calculate",
"gregorian",
"year",
"from",
"Buddhist",
"year",
"and",
"month"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/date/Buddhist.js#L71-L86 | train | Converts Buddhist to gregorian | [
30522,
3853,
2000,
17603,
20255,
2937,
1006,
27885,
6784,
19114,
3367,
1007,
1063,
13075,
29464,
8180,
7559,
3723,
14644,
1027,
5415,
13701,
1012,
2131,
24140,
7559,
2102,
13701,
1006,
8094,
13874,
1012,
7992,
1010,
1014,
1007,
1012,
2095,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
chartjs/Chart.js | src/controllers/controller.doughnut.js | function(datasetIndex) {
var ringWeightOffset = 0;
for (var i = 0; i < datasetIndex; ++i) {
if (this.chart.isDatasetVisible(i)) {
ringWeightOffset += this._getRingWeight(i);
}
}
return ringWeightOffset;
} | javascript | function(datasetIndex) {
var ringWeightOffset = 0;
for (var i = 0; i < datasetIndex; ++i) {
if (this.chart.isDatasetVisible(i)) {
ringWeightOffset += this._getRingWeight(i);
}
}
return ringWeightOffset;
} | [
"function",
"(",
"datasetIndex",
")",
"{",
"var",
"ringWeightOffset",
"=",
"0",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"datasetIndex",
";",
"++",
"i",
")",
"{",
"if",
"(",
"this",
".",
"chart",
".",
"isDatasetVisible",
"(",
"i",
")",... | Get radius length offset of the dataset in relation to the visible datasets weights. This allows determining the inner and outer radius correctly
@private | [
"Get",
"radius",
"length",
"offset",
"of",
"the",
"dataset",
"in",
"relation",
"to",
"the",
"visible",
"datasets",
"weights",
".",
"This",
"allows",
"determining",
"the",
"inner",
"and",
"outer",
"radius",
"correctly"
] | f093c36574d290330ed623e60fbd070421c730d5 | https://github.com/chartjs/Chart.js/blob/f093c36574d290330ed623e60fbd070421c730d5/src/controllers/controller.doughnut.js#L401-L411 | train | Calculate the offset of the ring of the dataset | [
30522,
3853,
1006,
2951,
13462,
22254,
10288,
1007,
1063,
13075,
3614,
11179,
27475,
30524,
3388,
1009,
1027,
2023,
1012,
1035,
2131,
4892,
11179,
1006,
1045,
1007,
1025,
1065,
1065,
2709,
3614,
11179,
27475,
3388,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
jgraph/mxgraph | javascript/mxClient.js | function(state, x, y, hotspot, min, max)
{
hotspot = (hotspot != null) ? hotspot : 1;
min = (min != null) ? min : 0;
max = (max != null) ? max : 0;
if (hotspot > 0)
{
var cx = state.getCenterX();
var cy = state.getCenterY();
var w = state.width;
var h = state.height;
var start = mxUtils... | javascript | function(state, x, y, hotspot, min, max)
{
hotspot = (hotspot != null) ? hotspot : 1;
min = (min != null) ? min : 0;
max = (max != null) ? max : 0;
if (hotspot > 0)
{
var cx = state.getCenterX();
var cy = state.getCenterY();
var w = state.width;
var h = state.height;
var start = mxUtils... | [
"function",
"(",
"state",
",",
"x",
",",
"y",
",",
"hotspot",
",",
"min",
",",
"max",
")",
"{",
"hotspot",
"=",
"(",
"hotspot",
"!=",
"null",
")",
"?",
"hotspot",
":",
"1",
";",
"min",
"=",
"(",
"min",
"!=",
"null",
")",
"?",
"min",
":",
"0",... | Function: intersects
Returns true if the two rectangles intersect.
Parameters:
a - <mxRectangle> to be checked for intersection.
b - <mxRectangle> to be checked for intersection. | [
"Function",
":",
"intersects"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L4684-L4739 | train | Calculates the bounds of the region of the region | [
30522,
3853,
1006,
2110,
1010,
1060,
1010,
1061,
1010,
2980,
13102,
4140,
1010,
8117,
1010,
4098,
1007,
1063,
2980,
13102,
4140,
1027,
1006,
2980,
13102,
4140,
999,
1027,
19701,
1007,
1029,
2980,
13102,
4140,
1024,
1015,
1025,
8117,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
aframevr/aframe | src/core/a-entity.js | isComponentMixedIn | function isComponentMixedIn (name, mixinEls) {
var i;
var inMixin = false;
for (i = 0; i < mixinEls.length; ++i) {
inMixin = mixinEls[i].hasAttribute(name);
if (inMixin) { break; }
}
return inMixin;
} | javascript | function isComponentMixedIn (name, mixinEls) {
var i;
var inMixin = false;
for (i = 0; i < mixinEls.length; ++i) {
inMixin = mixinEls[i].hasAttribute(name);
if (inMixin) { break; }
}
return inMixin;
} | [
"function",
"isComponentMixedIn",
"(",
"name",
",",
"mixinEls",
")",
"{",
"var",
"i",
";",
"var",
"inMixin",
"=",
"false",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"mixinEls",
".",
"length",
";",
"++",
"i",
")",
"{",
"inMixin",
"=",
"mixinEls... | Check if any mixins contains a component.
@param {string} name - Component name.
@param {array} mixinEls - Array of <a-mixin>s. | [
"Check",
"if",
"any",
"mixins",
"contains",
"a",
"component",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/core/a-entity.js#L883-L891 | train | Check if a component is mixed in a mixin | [
30522,
3853,
2003,
9006,
29513,
3372,
4328,
19068,
2378,
1006,
2171,
1010,
4666,
3170,
4877,
1007,
1063,
13075,
1045,
1025,
13075,
1999,
4328,
20303,
1027,
6270,
1025,
2005,
1006,
1045,
1027,
1014,
1025,
1045,
1026,
4666,
3170,
4877,
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/LiveDevelopment/MultiBrowserImpl/language/HTMLInstrumentation.js | getUnappliedEditList | function getUnappliedEditList(editor, changeList) {
var cachedValue = _cachedValues[editor.document.file.fullPath];
// We might not have a previous DOM if the document was empty before this edit.
if (!cachedValue || !cachedValue.dom || _cachedValues[editor.document.file.fullPath].invalid) {
... | javascript | function getUnappliedEditList(editor, changeList) {
var cachedValue = _cachedValues[editor.document.file.fullPath];
// We might not have a previous DOM if the document was empty before this edit.
if (!cachedValue || !cachedValue.dom || _cachedValues[editor.document.file.fullPath].invalid) {
... | [
"function",
"getUnappliedEditList",
"(",
"editor",
",",
"changeList",
")",
"{",
"var",
"cachedValue",
"=",
"_cachedValues",
"[",
"editor",
".",
"document",
".",
"file",
".",
"fullPath",
"]",
";",
"// We might not have a previous DOM if the document was empty before this e... | Calculates the DOM edits that are needed to update the browser from the state the
editor was in the last time that scanDocument(), getInstrumentedHTML(), or
getUnappliedEditList() was called (whichever is most recent). Caches this state so
it can be used as the base state for the next getUnappliedEditList().
For simpl... | [
"Calculates",
"the",
"DOM",
"edits",
"that",
"are",
"needed",
"to",
"update",
"the",
"browser",
"from",
"the",
"state",
"the",
"editor",
"was",
"in",
"the",
"last",
"time",
"that",
"scanDocument",
"()",
"getInstrumentedHTML",
"()",
"or",
"getUnappliedEditList",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/language/HTMLInstrumentation.js#L564-L593 | train | Get the unapplied edit list | [
30522,
3853,
2131,
9521,
9397,
8751,
5732,
4183,
9863,
1006,
3559,
1010,
2689,
9863,
1007,
1063,
13075,
17053,
2094,
10175,
5657,
1027,
1035,
17053,
2094,
10175,
15808,
1031,
3559,
1012,
6254,
1012,
5371,
1012,
2440,
15069,
1033,
1025,
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... |
jgraph/mxgraph | javascript/mxClient.js | function(x1, y1, x2, y2, px, py)
{
x2 -= x1;
y2 -= y1;
px -= x1;
py -= y1;
var ccw = px * y2 - py * x2;
if (ccw == 0.0)
{
ccw = px * x2 + py * y2;
if (ccw > 0.0)
{
px -= x2;
py -= y2;
ccw = px * x2 + py * y2;
if (ccw < 0.0)
{
ccw = 0.0;
... | javascript | function(x1, y1, x2, y2, px, py)
{
x2 -= x1;
y2 -= y1;
px -= x1;
py -= y1;
var ccw = px * y2 - py * x2;
if (ccw == 0.0)
{
ccw = px * x2 + py * y2;
if (ccw > 0.0)
{
px -= x2;
py -= y2;
ccw = px * x2 + py * y2;
if (ccw < 0.0)
{
ccw = 0.0;
... | [
"function",
"(",
"x1",
",",
"y1",
",",
"x2",
",",
"y2",
",",
"px",
",",
"py",
")",
"{",
"x2",
"-=",
"x1",
";",
"y2",
"-=",
"y1",
";",
"px",
"-=",
"x1",
";",
"py",
"-=",
"y1",
";",
"var",
"ccw",
"=",
"px",
"*",
"y2",
"-",
"py",
"*",
"x2"... | Function: relativeCcw
Returns 1 if the given point on the right side of the segment, 0 if its
on the segment, and -1 if the point is on the left side of the segment.
Parameters:
x1 - X-coordinate of the startpoint of the segment.
y1 - Y-coordinate of the startpoint of the segment.
x2 - X-coordinate of the endpoint o... | [
"Function",
":",
"relativeCcw"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L5131-L5157 | train | Compute the cCW of a curve | [
30522,
3853,
1006,
1060,
2487,
1010,
1061,
2487,
1010,
1060,
2475,
1010,
1061,
2475,
1010,
1052,
2595,
1010,
1052,
2100,
1007,
1063,
1060,
2475,
1011,
1027,
1060,
2487,
1025,
1061,
2475,
1011,
1027,
1061,
2487,
1025,
1052,
2595,
1011,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/project/FileTreeView.js | function (nextProps, nextState) {
return nextProps.forceRender ||
this.props.treeData !== nextProps.treeData ||
this.props.sortDirectoriesFirst !== nextProps.sortDirectoriesFirst ||
this.props.extensions !== nextProps.extensions ||
this.props.s... | javascript | function (nextProps, nextState) {
return nextProps.forceRender ||
this.props.treeData !== nextProps.treeData ||
this.props.sortDirectoriesFirst !== nextProps.sortDirectoriesFirst ||
this.props.extensions !== nextProps.extensions ||
this.props.s... | [
"function",
"(",
"nextProps",
",",
"nextState",
")",
"{",
"return",
"nextProps",
".",
"forceRender",
"||",
"this",
".",
"props",
".",
"treeData",
"!==",
"nextProps",
".",
"treeData",
"||",
"this",
".",
"props",
".",
"sortDirectoriesFirst",
"!==",
"nextProps",
... | Update for any change in the tree data or directory sorting preference. | [
"Update",
"for",
"any",
"change",
"in",
"the",
"tree",
"data",
"or",
"directory",
"sorting",
"preference",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L1127-L1133 | train | Check if the treeData and sortDirectoriesFirst properties are the same as the current treeData and the current sortDirectoriesFirst properties. | [
30522,
3853,
1006,
2279,
21572,
4523,
1010,
2279,
9153,
2618,
1007,
1063,
2709,
2279,
21572,
4523,
1012,
2486,
7389,
4063,
1064,
1064,
2023,
1012,
24387,
1012,
3392,
2850,
2696,
999,
1027,
1027,
2279,
21572,
4523,
1012,
3392,
2850,
2696,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.support/src/sap/ui/support/supportRules/RuleSet.js | function (oSettings) {
oSettings = oSettings || {};
if (!oSettings.name) {
jQuery.sap.log.error("Please provide a name for the RuleSet.");
}
if (mRuleSets[oSettings.name]) {
return mRuleSets[oSettings.name];
}
this._oSettings = oSettings;
this._mRules = {};
mRuleSets[oSettings.name] = this;
} | javascript | function (oSettings) {
oSettings = oSettings || {};
if (!oSettings.name) {
jQuery.sap.log.error("Please provide a name for the RuleSet.");
}
if (mRuleSets[oSettings.name]) {
return mRuleSets[oSettings.name];
}
this._oSettings = oSettings;
this._mRules = {};
mRuleSets[oSettings.name] = this;
} | [
"function",
"(",
"oSettings",
")",
"{",
"oSettings",
"=",
"oSettings",
"||",
"{",
"}",
";",
"if",
"(",
"!",
"oSettings",
".",
"name",
")",
"{",
"jQuery",
".",
"sap",
".",
"log",
".",
"error",
"(",
"\"Please provide a name for the RuleSet.\"",
")",
";",
"... | Creates a RuleSet.
The RuleSet can store multiple rules concerning namespaces.
<h3>Usage</h3>
The RuleSet is an interface used to create, update and delete rulesets.
@class
@public
@constructor
@namespace
@name sap.ui.support.RuleSet
@memberof sap.ui.support
@author SAP SE
@version ${version}
@param {object} oSettings... | [
"Creates",
"a",
"RuleSet",
".",
"The",
"RuleSet",
"can",
"store",
"multiple",
"rules",
"concerning",
"namespaces",
".",
"<h3",
">",
"Usage<",
"/",
"h3",
">",
"The",
"RuleSet",
"is",
"an",
"interface",
"used",
"to",
"create",
"update",
"and",
"delete",
"rul... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.support/src/sap/ui/support/supportRules/RuleSet.js#L42-L56 | train | Creates a new RuleSet instance. | [
30522,
3853,
1006,
9808,
18319,
3070,
2015,
1007,
1063,
9808,
18319,
3070,
2015,
1027,
9808,
18319,
3070,
2015,
1064,
1064,
1063,
1065,
1025,
2065,
1006,
999,
9808,
18319,
3070,
2015,
1012,
2171,
1007,
1063,
1046,
4226,
2854,
1012,
20066,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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, inheritedMetadata) {
var inheritedMetadataProperties = inheritedMetadata.getProperties();
var result = Object.create(null);
result.meta = Object.create(null);
result.meta.controlName = inheritedMetadata.getName();
result.properties = Object.create(null);
Object.keys(inherite... | javascript | function (control, inheritedMetadata) {
var inheritedMetadataProperties = inheritedMetadata.getProperties();
var result = Object.create(null);
result.meta = Object.create(null);
result.meta.controlName = inheritedMetadata.getName();
result.properties = Object.create(null);
Object.keys(inherite... | [
"function",
"(",
"control",
",",
"inheritedMetadata",
")",
"{",
"var",
"inheritedMetadataProperties",
"=",
"inheritedMetadata",
".",
"getProperties",
"(",
")",
";",
"var",
"result",
"=",
"Object",
".",
"create",
"(",
"null",
")",
";",
"result",
".",
"meta",
... | Copies the inherited properties of a UI5 control from the metadata.
@param {Object} control - UI5 Control.
@param {Object} inheritedMetadata - UI5 control metadata.
@returns {Object}
@private | [
"Copies",
"the",
"inherited",
"properties",
"of",
"a",
"UI5",
"control",
"from",
"the",
"metadata",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/ToolsAPI.js#L224-L239 | train | Returns a new object with properties and meta properties of the inherited metadata | [
30522,
3853,
1006,
2491,
1010,
7900,
11368,
8447,
2696,
1007,
1063,
13075,
7900,
11368,
8447,
2696,
21572,
4842,
7368,
1027,
7900,
11368,
8447,
2696,
1012,
2131,
21572,
4842,
7368,
1006,
1007,
1025,
13075,
2765,
1027,
4874,
1012,
3443,
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... | |
grpc/grpc-node | packages/grpc-native-core/src/server.js | sendMetadata | function sendMetadata(responseMetadata) {
/* jshint validthis: true */
var self = this;
if (!this.call.metadataSent) {
this.call.metadataSent = true;
var batch = {};
batch[grpc.opType.SEND_INITIAL_METADATA] =
responseMetadata._getCoreRepresentation();
this.call.startBatch(batch, function(e... | javascript | function sendMetadata(responseMetadata) {
/* jshint validthis: true */
var self = this;
if (!this.call.metadataSent) {
this.call.metadataSent = true;
var batch = {};
batch[grpc.opType.SEND_INITIAL_METADATA] =
responseMetadata._getCoreRepresentation();
this.call.startBatch(batch, function(e... | [
"function",
"sendMetadata",
"(",
"responseMetadata",
")",
"{",
"/* jshint validthis: true */",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"!",
"this",
".",
"call",
".",
"metadataSent",
")",
"{",
"this",
".",
"call",
".",
"metadataSent",
"=",
"true",
";",
... | Send the initial metadata for a writable stream.
@alias grpc~ServerUnaryCall#sendMetadata
@param {grpc.Metadata} responseMetadata Metadata to send | [
"Send",
"the",
"initial",
"metadata",
"for",
"a",
"writable",
"stream",
"."
] | b36b285f4cdb334bbd48f74c12c13bec69961488 | https://github.com/grpc/grpc-node/blob/b36b285f4cdb334bbd48f74c12c13bec69961488/packages/grpc-native-core/src/server.js#L473-L488 | train | Send metadata to the cluster | [
30522,
3853,
4604,
11368,
8447,
2696,
1006,
3433,
11368,
8447,
2696,
1007,
1063,
1013,
1008,
1046,
17426,
2102,
9398,
15222,
2015,
1024,
2995,
1008,
1013,
13075,
2969,
1027,
2023,
1025,
2065,
1006,
999,
2023,
1012,
2655,
1012,
27425,
5054,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/editor/EditorStatusBar.js | _formatCountable | function _formatCountable(number, singularStr, pluralStr) {
return StringUtils.format(number > 1 ? pluralStr : singularStr, number);
} | javascript | function _formatCountable(number, singularStr, pluralStr) {
return StringUtils.format(number > 1 ? pluralStr : singularStr, number);
} | [
"function",
"_formatCountable",
"(",
"number",
",",
"singularStr",
",",
"pluralStr",
")",
"{",
"return",
"StringUtils",
".",
"format",
"(",
"number",
">",
"1",
"?",
"pluralStr",
":",
"singularStr",
",",
"number",
")",
";",
"}"
] | Determine string based on count
@param {number} number Count
@param {string} singularStr Singular string
@param {string} pluralStr Plural string
@return {string} Proper string to use for count | [
"Determine",
"string",
"based",
"on",
"count"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorStatusBar.js#L80-L82 | train | Format a countable string | [
30522,
3853,
1035,
4289,
3597,
16671,
3085,
1006,
2193,
1010,
13048,
3367,
2099,
1010,
13994,
3367,
2099,
1007,
1063,
2709,
5164,
21823,
4877,
1012,
4289,
1006,
2193,
1028,
1015,
1029,
13994,
3367,
2099,
1024,
13048,
3367,
2099,
1010,
2193,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.