repo stringclasses 195
values | path stringlengths 4 99 | func_name stringlengths 0 41 | original_string stringlengths 72 56.1k | language stringclasses 1
value | code stringlengths 72 56.1k | code_tokens listlengths 25 8.12k | docstring stringlengths 2 12.5k | docstring_tokens listlengths 1 449 | sha stringclasses 197
values | url stringlengths 88 186 | partition stringclasses 1
value | summary stringlengths 8 338 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cytoscape/cytoscape.js | dist/cytoscape.esm.js | degreeCentrality | function degreeCentrality(options) {
options = defaults$1(options);
var cy = this.cy();
var callingEles = this;
var _options = options,
root = _options.root,
weight = _options.weight,
directed = _options.directed,
alpha = _options.alpha;
root = cy.collection(root)[0];... | javascript | function degreeCentrality(options) {
options = defaults$1(options);
var cy = this.cy();
var callingEles = this;
var _options = options,
root = _options.root,
weight = _options.weight,
directed = _options.directed,
alpha = _options.alpha;
root = cy.collection(root)[0];... | [
"function",
"degreeCentrality",
"(",
"options",
")",
"{",
"options",
"=",
"defaults$1",
"(",
"options",
")",
";",
"var",
"cy",
"=",
"this",
".",
"cy",
"(",
")",
";",
"var",
"callingEles",
"=",
"this",
";",
"var",
"_options",
"=",
"options",
",",
"root"... | degreeCentralityNormalized Implemented from the algorithm in Opsahl's paper "Node centrality in weighted networks: Generalizing degree and shortest paths" check the heading 2 "Degree" | [
"degreeCentralityNormalized",
"Implemented",
"from",
"the",
"algorithm",
"in",
"Opsahl",
"s",
"paper",
"Node",
"centrality",
"in",
"weighted",
"networks",
":",
"Generalizing",
"degree",
"and",
"shortest",
"paths",
"check",
"the",
"heading",
"2",
"Degree"
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L3440-L3490 | train | Returns degree of centrality of the current project. | [
30522,
3853,
3014,
13013,
7941,
3012,
1006,
7047,
1007,
1063,
7047,
1027,
12398,
2015,
1002,
1015,
1006,
7047,
1007,
1025,
13075,
22330,
1027,
2023,
1012,
22330,
1006,
1007,
1025,
13075,
4214,
26741,
1027,
2023,
1025,
13075,
1035,
7047,
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... |
wuchangming/spy-debugger | buildin_modules/weinre/web/client/treeoutline.js | TreeOutline | function TreeOutline(listNode)
{
this.children = [];
this.selectedTreeElement = null;
this._childrenListNode = listNode;
this._childrenListNode.removeChildren();
this._knownTreeElements = [];
this._treeElementsExpandedState = [];
this.expandTreeElementsWhenArrowing = false;
this.root = t... | javascript | function TreeOutline(listNode)
{
this.children = [];
this.selectedTreeElement = null;
this._childrenListNode = listNode;
this._childrenListNode.removeChildren();
this._knownTreeElements = [];
this._treeElementsExpandedState = [];
this.expandTreeElementsWhenArrowing = false;
this.root = t... | [
"function",
"TreeOutline",
"(",
"listNode",
")",
"{",
"this",
".",
"children",
"=",
"[",
"]",
";",
"this",
".",
"selectedTreeElement",
"=",
"null",
";",
"this",
".",
"_childrenListNode",
"=",
"listNode",
";",
"this",
".",
"_childrenListNode",
".",
"removeChi... | /*
Copyright (C) 2007 Apple Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following dis... | [
"/",
"*",
"Copyright",
"(",
"C",
")",
"2007",
"Apple",
"Inc",
".",
"All",
"rights",
"reserved",
"."
] | 55c1dda0dff0c44920673711656ddfd7ff03c307 | https://github.com/wuchangming/spy-debugger/blob/55c1dda0dff0c44920673711656ddfd7ff03c307/buildin_modules/weinre/web/client/treeoutline.js#L29-L46 | train | A TreeOutline represents a tree of children. | [
30522,
3853,
3392,
5833,
4179,
1006,
2862,
3630,
3207,
1007,
1063,
2023,
1012,
2336,
1027,
1031,
1033,
1025,
2023,
1012,
3479,
13334,
12260,
3672,
1027,
19701,
1025,
2023,
1012,
1035,
2336,
9863,
3630,
3207,
1027,
2862,
3630,
3207,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/base/Log.js | log | function log(iLevel, sMessage, sDetails, sComponent, fnSupportInfo) {
if (!fnSupportInfo && !sComponent && typeof sDetails === "function") {
fnSupportInfo = sDetails;
sDetails = "";
}
if (!fnSupportInfo && typeof sComponent === "function") {
fnSupportInfo = sComponent;
sComponent = "";
}
sCompone... | javascript | function log(iLevel, sMessage, sDetails, sComponent, fnSupportInfo) {
if (!fnSupportInfo && !sComponent && typeof sDetails === "function") {
fnSupportInfo = sDetails;
sDetails = "";
}
if (!fnSupportInfo && typeof sComponent === "function") {
fnSupportInfo = sComponent;
sComponent = "";
}
sCompone... | [
"function",
"log",
"(",
"iLevel",
",",
"sMessage",
",",
"sDetails",
",",
"sComponent",
",",
"fnSupportInfo",
")",
"{",
"if",
"(",
"!",
"fnSupportInfo",
"&&",
"!",
"sComponent",
"&&",
"typeof",
"sDetails",
"===",
"\"function\"",
")",
"{",
"fnSupportInfo",
"="... | Creates a new log entry depending on its level and component.
If the given level is higher than the max level for the given component
(or higher than the global level, if no component is given),
then no entry is created and <code>undefined</code> is returned.
If an <code>Error</code> is passed via <code>sDetails</cod... | [
"Creates",
"a",
"new",
"log",
"entry",
"depending",
"on",
"its",
"level",
"and",
"component",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/base/Log.js#L359-L443 | train | Logs to the console. | [
30522,
3853,
8833,
1006,
17869,
15985,
1010,
15488,
7971,
4270,
1010,
17371,
12928,
12146,
1010,
8040,
25377,
5643,
3372,
1010,
1042,
3619,
6279,
6442,
2378,
14876,
1007,
1063,
2065,
1006,
999,
1042,
3619,
6279,
6442,
2378,
14876,
1004,
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... |
nhn/tui.editor | src/js/extensions/table/mergedTableUI.js | _changeContent | function _changeContent(popupTableUtils) {
const POPUP_CONTENT = [
`<button type="button" class="te-table-add-row">${i18n.get('Add row')}</button>`,
`<button type="button" class="te-table-add-col">${i18n.get('Add col')}</button>`,
`<button type="button" class="te-table-remove-row">${i18n.get('Remove row')... | javascript | function _changeContent(popupTableUtils) {
const POPUP_CONTENT = [
`<button type="button" class="te-table-add-row">${i18n.get('Add row')}</button>`,
`<button type="button" class="te-table-add-col">${i18n.get('Add col')}</button>`,
`<button type="button" class="te-table-remove-row">${i18n.get('Remove row')... | [
"function",
"_changeContent",
"(",
"popupTableUtils",
")",
"{",
"const",
"POPUP_CONTENT",
"=",
"[",
"`",
"${",
"i18n",
".",
"get",
"(",
"'Add row'",
")",
"}",
"`",
",",
"`",
"${",
"i18n",
".",
"get",
"(",
"'Add col'",
")",
"}",
"`",
",",
"`",
"${",
... | Change contextmenu content.
@param {object} popupTableUtils - PopupTableUtils instance for managing contextmenu of table
@private | [
"Change",
"contextmenu",
"content",
"."
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/table/mergedTableUI.js#L15-L34 | train | Change the content of the popup table | [
30522,
3853,
1035,
2689,
8663,
6528,
2102,
1006,
3769,
29441,
3085,
21823,
4877,
1007,
1063,
9530,
3367,
3769,
6279,
1035,
4180,
1027,
1031,
1036,
1026,
6462,
2828,
1027,
1000,
6462,
1000,
2465,
1027,
1000,
8915,
1011,
2795,
1011,
30524,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/LiveDevelopment/Agents/DOMHelpers.js | _find | function _find(src, match, skip, quotes, comments) {
if (typeof match === "string") {
match = [match, match.length];
}
if (skip === undefined) {
skip = 0;
}
var i, activeQuote, isComment = false;
for (i = skip; i < src.length; i++) {
if... | javascript | function _find(src, match, skip, quotes, comments) {
if (typeof match === "string") {
match = [match, match.length];
}
if (skip === undefined) {
skip = 0;
}
var i, activeQuote, isComment = false;
for (i = skip; i < src.length; i++) {
if... | [
"function",
"_find",
"(",
"src",
",",
"match",
",",
"skip",
",",
"quotes",
",",
"comments",
")",
"{",
"if",
"(",
"typeof",
"match",
"===",
"\"string\"",
")",
"{",
"match",
"=",
"[",
"match",
",",
"match",
".",
"length",
"]",
";",
"}",
"if",
"(",
... | Find the next match using several constraints
@param {string} source string
@param {string} or [{regex}, {length}] the match definition
@param {integer} ignore characters before this offset
@param {boolean} watch for quotes
@param [{string},{string}] watch for comments | [
"Find",
"the",
"next",
"match",
"using",
"several",
"constraints"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/DOMHelpers.js#L66-L96 | train | Find the first match in the source string | [
30522,
3853,
1035,
2424,
1006,
5034,
2278,
1010,
2674,
1010,
13558,
1010,
16614,
1010,
7928,
1007,
1063,
2065,
1006,
2828,
11253,
2674,
1027,
1027,
1027,
1000,
5164,
1000,
1007,
1063,
2674,
1027,
1031,
2674,
1010,
2674,
1012,
3091,
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... |
GitbookIO/gitbook | lib/templating/postRender.js | postRender | function postRender(engine, output) {
var content = output.getContent();
var blocks = output.getBlocks();
var result = replaceBlocks(content, blocks);
return Promise.forEach(blocks, function(block) {
var post = block.get('post');
if (!post) {
return;
}
ret... | javascript | function postRender(engine, output) {
var content = output.getContent();
var blocks = output.getBlocks();
var result = replaceBlocks(content, blocks);
return Promise.forEach(blocks, function(block) {
var post = block.get('post');
if (!post) {
return;
}
ret... | [
"function",
"postRender",
"(",
"engine",
",",
"output",
")",
"{",
"var",
"content",
"=",
"output",
".",
"getContent",
"(",
")",
";",
"var",
"blocks",
"=",
"output",
".",
"getBlocks",
"(",
")",
";",
"var",
"result",
"=",
"replaceBlocks",
"(",
"content",
... | Post render a template:
- Execute "post" for blocks
- Replace block content
@param {TemplateEngine} engine
@param {TemplateOutput} content
@return {Promise<String>} | [
"Post",
"render",
"a",
"template",
":",
"-",
"Execute",
"post",
"for",
"blocks",
"-",
"Replace",
"block",
"content"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/templating/postRender.js#L35-L51 | train | Post render the content of the output | [
30522,
3853,
2695,
7389,
4063,
1006,
3194,
1010,
6434,
1007,
1063,
13075,
4180,
1027,
6434,
1012,
2131,
8663,
6528,
2102,
1006,
1007,
1025,
13075,
5991,
1027,
6434,
1012,
2131,
23467,
2015,
1006,
1007,
1025,
13075,
2765,
1027,
5672,
23467,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fex-team/webuploader | build/tasks/concat.js | filesFilter | function filesFilter( f, files ) {
var cwd = f.cwd || '',
ret = [],
process = function( file ) {
var fileinfo = path.join( cwd, file ),
dirpath = path.dirname( fileinfo ),
depends = [],
str, matches, idx;
... | javascript | function filesFilter( f, files ) {
var cwd = f.cwd || '',
ret = [],
process = function( file ) {
var fileinfo = path.join( cwd, file ),
dirpath = path.dirname( fileinfo ),
depends = [],
str, matches, idx;
... | [
"function",
"filesFilter",
"(",
"f",
",",
"files",
")",
"{",
"var",
"cwd",
"=",
"f",
".",
"cwd",
"||",
"''",
",",
"ret",
"=",
"[",
"]",
",",
"process",
"=",
"function",
"(",
"file",
")",
"{",
"var",
"fileinfo",
"=",
"path",
".",
"join",
"(",
"c... | 排序,把依赖的文件移动到最上面。 | [
"排序,把依赖的文件移动到最上面。"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/build/tasks/concat.js#L38-L103 | train | filter files | [
30522,
3853,
6764,
8873,
21928,
1006,
1042,
1010,
6764,
1007,
1063,
13075,
19296,
2094,
1027,
1042,
1012,
19296,
2094,
1064,
1064,
1005,
1005,
1010,
2128,
2102,
1027,
1031,
1033,
1010,
2832,
1027,
3853,
1006,
5371,
1007,
1063,
13075,
5371,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
goldfire/howler.js | dist/howler.js | function() {
var self = this;
var limit = self._pool;
var cnt = 0;
var i = 0;
// If there are less sounds than the max pool size, we are done.
if (self._sounds.length < limit) {
return;
}
// Count the number of inactive sounds.
for (i=0; i<self._sounds.len... | javascript | function() {
var self = this;
var limit = self._pool;
var cnt = 0;
var i = 0;
// If there are less sounds than the max pool size, we are done.
if (self._sounds.length < limit) {
return;
}
// Count the number of inactive sounds.
for (i=0; i<self._sounds.len... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"limit",
"=",
"self",
".",
"_pool",
";",
"var",
"cnt",
"=",
"0",
";",
"var",
"i",
"=",
"0",
";",
"// If there are less sounds than the max pool size, we are done.",
"if",
"(",
"self",
".",
... | Drain excess inactive sounds from the pool. | [
"Drain",
"excess",
"inactive",
"sounds",
"from",
"the",
"pool",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/dist/howler.js#L2028-L2063 | train | Remove all inactive sounds from the pool. | [
30522,
3853,
1006,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
13075,
5787,
1027,
2969,
1012,
1035,
4770,
1025,
13075,
27166,
2102,
1027,
1014,
1025,
13075,
1045,
1027,
1014,
1025,
1013,
1013,
2065,
2045,
2024,
2625,
4165,
2084,
1996,
4098,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/search/ScrollTrackMarkers.js | setVisible | function setVisible(curEditor, visible) {
// short-circuit no-ops
if ((visible && curEditor === editor) || (!visible && !editor)) {
return;
}
if (visible) {
console.assert(!editor);
editor = curEditor;
// Don't support inline editors yet ... | javascript | function setVisible(curEditor, visible) {
// short-circuit no-ops
if ((visible && curEditor === editor) || (!visible && !editor)) {
return;
}
if (visible) {
console.assert(!editor);
editor = curEditor;
// Don't support inline editors yet ... | [
"function",
"setVisible",
"(",
"curEditor",
",",
"visible",
")",
"{",
"// short-circuit no-ops",
"if",
"(",
"(",
"visible",
"&&",
"curEditor",
"===",
"editor",
")",
"||",
"(",
"!",
"visible",
"&&",
"!",
"editor",
")",
")",
"{",
"return",
";",
"}",
"if",
... | Add or remove the tickmark track from the editor's UI | [
"Add",
"or",
"remove",
"the",
"tickmark",
"track",
"from",
"the",
"editor",
"s",
"UI"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/ScrollTrackMarkers.js#L173-L210 | train | set visible flag | [
30522,
3853,
2275,
11365,
7028,
1006,
21391,
15660,
1010,
5710,
1007,
1063,
1013,
1013,
2460,
1011,
4984,
2053,
1011,
23092,
2065,
1006,
1006,
5710,
1004,
1004,
21391,
15660,
1027,
1027,
1027,
3559,
1007,
1064,
1064,
1006,
999,
5710,
1004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/JSUtils/ScopeManager.js | getJumptoDef | function getJumptoDef(fileInfo, offset) {
postMessage({
type: MessageIds.TERN_JUMPTODEF_MSG,
fileInfo: fileInfo,
offset: offset
});
return addPendingRequest(fileInfo.name, offset, MessageIds.TERN_JUMPTODEF_MSG);
} | javascript | function getJumptoDef(fileInfo, offset) {
postMessage({
type: MessageIds.TERN_JUMPTODEF_MSG,
fileInfo: fileInfo,
offset: offset
});
return addPendingRequest(fileInfo.name, offset, MessageIds.TERN_JUMPTODEF_MSG);
} | [
"function",
"getJumptoDef",
"(",
"fileInfo",
",",
"offset",
")",
"{",
"postMessage",
"(",
"{",
"type",
":",
"MessageIds",
".",
"TERN_JUMPTODEF_MSG",
",",
"fileInfo",
":",
"fileInfo",
",",
"offset",
":",
"offset",
"}",
")",
";",
"return",
"addPendingRequest",
... | Get a Promise for the definition from TernJS, for the file & offset passed in.
@param {{type: string, name: string, offsetLines: number, text: string}} fileInfo
- type of update, name of file, and the text of the update.
For "full" updates, the whole text of the file is present. For "part" updates,
the changed portion ... | [
"Get",
"a",
"Promise",
"for",
"the",
"definition",
"from",
"TernJS",
"for",
"the",
"file",
"&",
"offset",
"passed",
"in",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L345-L353 | train | Get the jumpto definition | [
30522,
3853,
2131,
9103,
27718,
10244,
2546,
1006,
5371,
2378,
14876,
1010,
16396,
1007,
1063,
2695,
7834,
3736,
3351,
1006,
1063,
2828,
1024,
4471,
9821,
1012,
28774,
2078,
1035,
5376,
3406,
3207,
2546,
1035,
5796,
2290,
1010,
5371,
2378,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
electron/electron | script/bump-version.js | commitVersionBump | async function commitVersionBump (version) {
const gitDir = path.resolve(__dirname, '..')
const gitArgs = ['commit', '-a', '-m', `Bump v${version}`, '-n']
await GitProcess.exec(gitArgs, gitDir)
} | javascript | async function commitVersionBump (version) {
const gitDir = path.resolve(__dirname, '..')
const gitArgs = ['commit', '-a', '-m', `Bump v${version}`, '-n']
await GitProcess.exec(gitArgs, gitDir)
} | [
"async",
"function",
"commitVersionBump",
"(",
"version",
")",
"{",
"const",
"gitDir",
"=",
"path",
".",
"resolve",
"(",
"__dirname",
",",
"'..'",
")",
"const",
"gitArgs",
"=",
"[",
"'commit'",
",",
"'-a'",
",",
"'-m'",
",",
"`",
"${",
"version",
"}",
... | push bump commit to release branch | [
"push",
"bump",
"commit",
"to",
"release",
"branch"
] | 6e29611788277729647acf465f10db1ea6f15788 | https://github.com/electron/electron/blob/6e29611788277729647acf465f10db1ea6f15788/script/bump-version.js#L135-L139 | train | Commit a version bump | [
30522,
2004,
6038,
2278,
3853,
10797,
27774,
8569,
8737,
1006,
2544,
1007,
1063,
9530,
3367,
21025,
2102,
4305,
2099,
1027,
4130,
1012,
10663,
1006,
1035,
1035,
16101,
18442,
1010,
1005,
1012,
1012,
1005,
1007,
9530,
3367,
21025,
7559,
5620... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-echarts | src/chart/treemap/TreemapView.js | renderBackground | function renderBackground(group, bg, useUpperLabel) {
// For tooltip.
bg.dataIndex = thisNode.dataIndex;
bg.seriesIndex = seriesModel.seriesIndex;
bg.setShape({x: 0, y: 0, width: thisWidth, height: thisHeight});
var visualBorderColor = thisNode.getVisual('borderColor', true);
... | javascript | function renderBackground(group, bg, useUpperLabel) {
// For tooltip.
bg.dataIndex = thisNode.dataIndex;
bg.seriesIndex = seriesModel.seriesIndex;
bg.setShape({x: 0, y: 0, width: thisWidth, height: thisHeight});
var visualBorderColor = thisNode.getVisual('borderColor', true);
... | [
"function",
"renderBackground",
"(",
"group",
",",
"bg",
",",
"useUpperLabel",
")",
"{",
"// For tooltip.",
"bg",
".",
"dataIndex",
"=",
"thisNode",
".",
"dataIndex",
";",
"bg",
".",
"seriesIndex",
"=",
"seriesModel",
".",
"seriesIndex",
";",
"bg",
".",
"set... | ---------------------------- | Procedures in renderNode | ---------------------------- | [
"----------------------------",
"|",
"Procedures",
"in",
"renderNode",
"|",
"----------------------------"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/treemap/TreemapView.js#L743-L776 | train | Render background | [
30522,
3853,
17552,
5963,
16365,
1006,
2177,
1010,
1038,
2290,
1010,
2224,
29547,
12190,
16336,
2140,
1007,
1063,
1013,
1013,
2005,
6994,
25101,
1012,
1038,
2290,
1012,
2951,
22254,
10288,
1027,
2023,
3630,
3207,
1012,
2951,
22254,
10288,
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... |
catapult-project/catapult | tracing/third_party/oboe/src/lists.js | reverseInner | function reverseInner( list, reversedAlready ) {
if( !list ) {
return reversedAlready;
}
return reverseInner(tail(list), cons(head(list), reversedAlready))
} | javascript | function reverseInner( list, reversedAlready ) {
if( !list ) {
return reversedAlready;
}
return reverseInner(tail(list), cons(head(list), reversedAlready))
} | [
"function",
"reverseInner",
"(",
"list",
",",
"reversedAlready",
")",
"{",
"if",
"(",
"!",
"list",
")",
"{",
"return",
"reversedAlready",
";",
"}",
"return",
"reverseInner",
"(",
"tail",
"(",
"list",
")",
",",
"cons",
"(",
"head",
"(",
"list",
")",
","... | js re-implementation of 3rd solution from: http://www.haskell.org/haskellwiki/99_questions/Solutions/5 | [
"js",
"re",
"-",
"implementation",
"of",
"3rd",
"solution",
"from",
":",
"http",
":",
"//",
"www",
".",
"haskell",
".",
"org",
"/",
"haskellwiki",
"/",
"99_questions",
"/",
"Solutions",
"/",
"5"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/lists.js#L176-L182 | train | reverseInner - reverse the list | [
30522,
3853,
7901,
23111,
2121,
1006,
2862,
1010,
11674,
2389,
16416,
5149,
1007,
1063,
2065,
1006,
999,
2862,
1007,
1063,
2709,
11674,
2389,
16416,
5149,
1025,
1065,
2709,
7901,
23111,
2121,
1006,
5725,
1006,
2862,
1007,
1010,
9530,
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... |
websockets/ws | lib/buffer-util.js | toArrayBuffer | function toArrayBuffer(buf) {
if (buf.byteLength === buf.buffer.byteLength) {
return buf.buffer;
}
return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
} | javascript | function toArrayBuffer(buf) {
if (buf.byteLength === buf.buffer.byteLength) {
return buf.buffer;
}
return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
} | [
"function",
"toArrayBuffer",
"(",
"buf",
")",
"{",
"if",
"(",
"buf",
".",
"byteLength",
"===",
"buf",
".",
"buffer",
".",
"byteLength",
")",
"{",
"return",
"buf",
".",
"buffer",
";",
"}",
"return",
"buf",
".",
"buffer",
".",
"slice",
"(",
"buf",
".",... | Converts a buffer to an `ArrayBuffer`.
@param {Buffer} buf The buffer to convert
@return {ArrayBuffer} Converted buffer
@public | [
"Converts",
"a",
"buffer",
"to",
"an",
"ArrayBuffer",
"."
] | 995c527c87d0d4833d8093c18dcfa2e4a41d9582 | https://github.com/websockets/ws/blob/995c527c87d0d4833d8093c18dcfa2e4a41d9582/lib/buffer-util.js#L67-L73 | train | Converts a buffer to an array of bytes | [
30522,
3853,
2000,
2906,
9447,
8569,
12494,
1006,
20934,
2546,
1007,
1063,
2065,
1006,
20934,
2546,
1012,
24880,
7770,
13512,
2232,
1027,
1027,
1027,
20934,
2546,
1012,
17698,
1012,
24880,
7770,
13512,
2232,
1007,
1063,
2709,
20934,
2546,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/project/WorkingSetSort.js | _setCurrentSort | function _setCurrentSort(newSort) {
if (_currentSort !== newSort) {
if (_currentSort !== null) {
_currentSort.setChecked(false);
}
if (_automaticSort) {
newSort.setChecked(true);
}
CommandManager.get(Commands.CMD_WORKIN... | javascript | function _setCurrentSort(newSort) {
if (_currentSort !== newSort) {
if (_currentSort !== null) {
_currentSort.setChecked(false);
}
if (_automaticSort) {
newSort.setChecked(true);
}
CommandManager.get(Commands.CMD_WORKIN... | [
"function",
"_setCurrentSort",
"(",
"newSort",
")",
"{",
"if",
"(",
"_currentSort",
"!==",
"newSort",
")",
"{",
"if",
"(",
"_currentSort",
"!==",
"null",
")",
"{",
"_currentSort",
".",
"setChecked",
"(",
"false",
")",
";",
"}",
"if",
"(",
"_automaticSort",... | Sets the current sort method and checks it on the context menu.
@private
@param {Sort} newSort | [
"Sets",
"the",
"current",
"sort",
"method",
"and",
"checks",
"it",
"on",
"the",
"context",
"menu",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/WorkingSetSort.js#L188-L201 | train | set current sort | [
30522,
3853,
1035,
2275,
10841,
14343,
7666,
11589,
1006,
2739,
11589,
1007,
1063,
2065,
1006,
1035,
14731,
11589,
999,
1027,
1027,
2739,
11589,
1007,
1063,
2065,
1006,
1035,
14731,
11589,
999,
1027,
1027,
19701,
1007,
1063,
1035,
14731,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/InlineTimingFunctionEditor/BezierCurveEditor.js | BezierCurveEditor | function BezierCurveEditor($parent, bezierCurve, callback) {
// Create the DOM structure, filling in localized strings via Mustache
this.$element = $(Mustache.render(BezierCurveEditorTemplate, Strings));
$parent.append(this.$element);
this._callback = callback;
this.dragElement ... | javascript | function BezierCurveEditor($parent, bezierCurve, callback) {
// Create the DOM structure, filling in localized strings via Mustache
this.$element = $(Mustache.render(BezierCurveEditorTemplate, Strings));
$parent.append(this.$element);
this._callback = callback;
this.dragElement ... | [
"function",
"BezierCurveEditor",
"(",
"$parent",
",",
"bezierCurve",
",",
"callback",
")",
"{",
"// Create the DOM structure, filling in localized strings via Mustache",
"this",
".",
"$element",
"=",
"$",
"(",
"Mustache",
".",
"render",
"(",
"BezierCurveEditorTemplate",
"... | Constructor for BezierCurveEditor Object. This control may be used standalone
or within an InlineTimingFunctionEditor inline widget.
@param {!jQuery} $parent DOM node into which to append the root of the bezier curve editor UI
@param {!RegExpMatch} bezierCurve RegExp match object of initially selected bezierCurve
@p... | [
"Constructor",
"for",
"BezierCurveEditor",
"Object",
".",
"This",
"control",
"may",
"be",
"used",
"standalone",
"or",
"within",
"an",
"InlineTimingFunctionEditor",
"inline",
"widget",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js#L515-L560 | train | BezierCurveEditor constructor. | [
30522,
3853,
2022,
21548,
10841,
2099,
3726,
2098,
15660,
1006,
1002,
6687,
1010,
2022,
21548,
10841,
2099,
3726,
1010,
2655,
5963,
1007,
1063,
1013,
1013,
3443,
1996,
14383,
3252,
1010,
8110,
1999,
22574,
7817,
3081,
28786,
2023,
1012,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/ODataBinding.js | ODataBinding | function ODataBinding() {
// maps a canonical path of a quasi-absolute or relative binding to a cache object that may
// be reused
this.mCacheByResourcePath = undefined;
this.oCachePromise = SyncPromise.resolve();
this.mCacheQueryOptions = undefined;
// used to create cache only for the latest call to #fetc... | javascript | function ODataBinding() {
// maps a canonical path of a quasi-absolute or relative binding to a cache object that may
// be reused
this.mCacheByResourcePath = undefined;
this.oCachePromise = SyncPromise.resolve();
this.mCacheQueryOptions = undefined;
// used to create cache only for the latest call to #fetc... | [
"function",
"ODataBinding",
"(",
")",
"{",
"// maps a canonical path of a quasi-absolute or relative binding to a cache object that may",
"// be reused",
"this",
".",
"mCacheByResourcePath",
"=",
"undefined",
";",
"this",
".",
"oCachePromise",
"=",
"SyncPromise",
".",
"resolve"... | A mixin for all OData V4 bindings.
@alias sap.ui.model.odata.v4.ODataBinding
@mixin | [
"A",
"mixin",
"for",
"all",
"OData",
"V4",
"bindings",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/ODataBinding.js#L27-L37 | train | OData Binding constructor | [
30522,
3853,
1051,
2850,
2696,
8428,
4667,
1006,
1007,
1063,
1013,
1013,
7341,
1037,
18562,
4130,
1997,
1037,
17982,
1011,
7619,
2030,
5816,
8031,
2000,
1037,
17053,
4874,
2008,
2089,
30524,
2023,
1012,
22432,
5403,
3762,
6072,
8162,
3401,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-js | lib/credentials.js | get | function get(callback) {
var self = this;
if (this.needsRefresh()) {
this.refresh(function(err) {
if (!err) self.expired = false; // reset expired flag
if (callback) callback(err);
});
} else if (callback) {
callback();
}
} | javascript | function get(callback) {
var self = this;
if (this.needsRefresh()) {
this.refresh(function(err) {
if (!err) self.expired = false; // reset expired flag
if (callback) callback(err);
});
} else if (callback) {
callback();
}
} | [
"function",
"get",
"(",
"callback",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"this",
".",
"needsRefresh",
"(",
")",
")",
"{",
"this",
".",
"refresh",
"(",
"function",
"(",
"err",
")",
"{",
"if",
"(",
"!",
"err",
")",
"self",
".",
"... | Gets the existing credentials, refreshing them if they are not yet loaded
or have expired. Users should call this method before using {refresh},
as this will not attempt to reload credentials when they are already
loaded into the object.
@callback callback function(err)
When this callback is called with no error, it m... | [
"Gets",
"the",
"existing",
"credentials",
"refreshing",
"them",
"if",
"they",
"are",
"not",
"yet",
"loaded",
"or",
"have",
"expired",
".",
"Users",
"should",
"call",
"this",
"method",
"before",
"using",
"{",
"refresh",
"}",
"as",
"this",
"will",
"not",
"at... | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/credentials.js#L119-L129 | train | Get the next resource in the cache | [
30522,
3853,
2131,
1006,
2655,
5963,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
2065,
1006,
2023,
1012,
3791,
2890,
19699,
9953,
1006,
1007,
1007,
1063,
2023,
1012,
25416,
21898,
1006,
3853,
1006,
9413,
2099,
1007,
1063,
2065,
1006,
999,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-js | lib/service.js | attemptFailEvent | function attemptFailEvent(request) {
var monitoringEvent = this.apiAttemptEvent(request);
var response = request.response;
var error = response.error;
if (response.httpResponse.statusCode > 299 ) {
if (error.code) monitoringEvent.AwsException = error.code;
if (error.message) monitoringEvent.... | javascript | function attemptFailEvent(request) {
var monitoringEvent = this.apiAttemptEvent(request);
var response = request.response;
var error = response.error;
if (response.httpResponse.statusCode > 299 ) {
if (error.code) monitoringEvent.AwsException = error.code;
if (error.message) monitoringEvent.... | [
"function",
"attemptFailEvent",
"(",
"request",
")",
"{",
"var",
"monitoringEvent",
"=",
"this",
".",
"apiAttemptEvent",
"(",
"request",
")",
";",
"var",
"response",
"=",
"request",
".",
"response",
";",
"var",
"error",
"=",
"response",
".",
"error",
";",
... | Add metrics of failed request.
@api private | [
"Add",
"metrics",
"of",
"failed",
"request",
"."
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/service.js#L367-L379 | train | Attempt to send an error to the service | [
30522,
3853,
3535,
7011,
9463,
15338,
1006,
5227,
1007,
1063,
13075,
8822,
18697,
3372,
1027,
2023,
1012,
17928,
19321,
6633,
13876,
18697,
3372,
1006,
5227,
1007,
1025,
13075,
3433,
1027,
5227,
1012,
3433,
1025,
13075,
7561,
1027,
3433,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/RemoteFileAdapter/RemoteFile.js | RemoteFile | function RemoteFile(protocol, fullPath, fileSystem) {
this._isFile = true;
this._isDirectory = false;
this.readOnly = true;
this._path = fullPath;
this._stat = _getStats(fullPath);
this._id = fullPath;
this._name = _getFileName(fullPath);
this._fileSystem ... | javascript | function RemoteFile(protocol, fullPath, fileSystem) {
this._isFile = true;
this._isDirectory = false;
this.readOnly = true;
this._path = fullPath;
this._stat = _getStats(fullPath);
this._id = fullPath;
this._name = _getFileName(fullPath);
this._fileSystem ... | [
"function",
"RemoteFile",
"(",
"protocol",
",",
"fullPath",
",",
"fileSystem",
")",
"{",
"this",
".",
"_isFile",
"=",
"true",
";",
"this",
".",
"_isDirectory",
"=",
"false",
";",
"this",
".",
"readOnly",
"=",
"true",
";",
"this",
".",
"_path",
"=",
"fu... | Model for a RemoteFile.
This class should *not* be instantiated directly. Use FileSystem.getFileForPath
See the FileSystem class for more details.
@constructor
@param {!string} fullPath The full path for this File.
@param {!FileSystem} fileSystem The file system associated with this File. | [
"Model",
"for",
"a",
"RemoteFile",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RemoteFileAdapter/RemoteFile.js#L70-L82 | train | RemoteFile constructor. | [
30522,
3853,
6556,
8873,
2571,
1006,
8778,
1010,
2440,
15069,
1010,
6764,
27268,
6633,
1007,
1063,
2023,
1012,
1035,
2003,
8873,
2571,
1027,
2995,
1025,
2023,
1012,
1035,
2003,
4305,
2890,
16761,
2100,
1027,
6270,
1025,
2023,
1012,
3191,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/widgets/Dialogs.js | showModalDialogUsingTemplate | function showModalDialogUsingTemplate(template, autoDismiss) {
if (autoDismiss === undefined) {
autoDismiss = true;
}
$("body").append("<div class='modal-wrapper'><div class='modal-inner-wrapper'></div></div>");
var result = new $.Deferred(),
promise = result.p... | javascript | function showModalDialogUsingTemplate(template, autoDismiss) {
if (autoDismiss === undefined) {
autoDismiss = true;
}
$("body").append("<div class='modal-wrapper'><div class='modal-inner-wrapper'></div></div>");
var result = new $.Deferred(),
promise = result.p... | [
"function",
"showModalDialogUsingTemplate",
"(",
"template",
",",
"autoDismiss",
")",
"{",
"if",
"(",
"autoDismiss",
"===",
"undefined",
")",
"{",
"autoDismiss",
"=",
"true",
";",
"}",
"$",
"(",
"\"body\"",
")",
".",
"append",
"(",
"\"<div class='modal-wrapper'>... | Creates a new modal dialog from a given template.
The template can either be a string or a jQuery object representing a DOM node that is *not* in the current DOM.
@param {string} template A string template or jQuery object to use as the dialog HTML.
@param {boolean=} autoDismiss Whether to automatically dismiss the di... | [
"Creates",
"a",
"new",
"modal",
"dialog",
"from",
"a",
"given",
"template",
".",
"The",
"template",
"can",
"either",
"be",
"a",
"string",
"or",
"a",
"jQuery",
"object",
"representing",
"a",
"DOM",
"node",
"that",
"is",
"*",
"not",
"*",
"in",
"the",
"cu... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/widgets/Dialogs.js#L287-L379 | train | Show a modal dialog using a template | [
30522,
3853,
2265,
5302,
9305,
27184,
8649,
18161,
18532,
15725,
1006,
23561,
1010,
8285,
10521,
15630,
2015,
1007,
1063,
2065,
1006,
8285,
10521,
15630,
2015,
1027,
1027,
1027,
6151,
28344,
1007,
1063,
8285,
10521,
15630,
2015,
1027,
2995,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | scanForFocusable | function scanForFocusable(target, selector) {
var elFound, items = target[0].querySelectorAll(selector);
// Find the last child element with the focus attribute
if (items && items.length){
items.length && angular.forEach(items, function(it) {
it = angular.element(it);
... | javascript | function scanForFocusable(target, selector) {
var elFound, items = target[0].querySelectorAll(selector);
// Find the last child element with the focus attribute
if (items && items.length){
items.length && angular.forEach(items, function(it) {
it = angular.element(it);
... | [
"function",
"scanForFocusable",
"(",
"target",
",",
"selector",
")",
"{",
"var",
"elFound",
",",
"items",
"=",
"target",
"[",
"0",
"]",
".",
"querySelectorAll",
"(",
"selector",
")",
";",
"// Find the last child element with the focus attribute",
"if",
"(",
"items... | Can target and nested children for specified Selector (attribute)
whose value may be an expression that evaluates to True/False. | [
"Can",
"target",
"and",
"nested",
"children",
"for",
"specified",
"Selector",
"(",
"attribute",
")",
"whose",
"value",
"may",
"be",
"an",
"expression",
"that",
"evaluates",
"to",
"True",
"/",
"False",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L198-L213 | train | Scan for focusable elements | [
30522,
3853,
13594,
29278,
14876,
7874,
3085,
1006,
4539,
1010,
27000,
1007,
1063,
13075,
17163,
28819,
1010,
5167,
1027,
4539,
1031,
1014,
1033,
1012,
23032,
11246,
22471,
6525,
3363,
1006,
27000,
1007,
1025,
1013,
1013,
2424,
1996,
2197,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
react-bootstrap/react-bootstrap | src/ProgressBar.js | onlyProgressBar | function onlyProgressBar(props, propName, componentName) {
const children = props[propName];
if (!children) {
return null;
}
let error = null;
React.Children.forEach(children, child => {
if (error) {
return;
}
/**
* Compare types in a way that works with libraries that patch and ... | javascript | function onlyProgressBar(props, propName, componentName) {
const children = props[propName];
if (!children) {
return null;
}
let error = null;
React.Children.forEach(children, child => {
if (error) {
return;
}
/**
* Compare types in a way that works with libraries that patch and ... | [
"function",
"onlyProgressBar",
"(",
"props",
",",
"propName",
",",
"componentName",
")",
"{",
"const",
"children",
"=",
"props",
"[",
"propName",
"]",
";",
"if",
"(",
"!",
"children",
")",
"{",
"return",
"null",
";",
"}",
"let",
"error",
"=",
"null",
"... | Validate that children, if any, are instances of `<ProgressBar>`. | [
"Validate",
"that",
"children",
"if",
"any",
"are",
"instances",
"of",
"<ProgressBar",
">",
"."
] | f0dc81f91ae90eb54bd1e4c04fa9419872d347dc | https://github.com/react-bootstrap/react-bootstrap/blob/f0dc81f91ae90eb54bd1e4c04fa9419872d347dc/src/ProgressBar.js#L14-L46 | train | Only ProgressBar component can contain only ProgressBar elements | [
30522,
3853,
2069,
21572,
17603,
4757,
8237,
1006,
24387,
1010,
17678,
18442,
1010,
6922,
18442,
1007,
1063,
9530,
3367,
2336,
1027,
24387,
1031,
17678,
18442,
1033,
1025,
2065,
1006,
999,
2336,
1007,
1063,
2709,
19701,
1025,
1065,
2292,
75... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
elastic/elasticsearch-js | api/api/ml.get_overall_buckets.js | buildMlGetOverallBuckets | function buildMlGetOverallBuckets (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.get_overall_buckets](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html) request
*
... | javascript | function buildMlGetOverallBuckets (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [ml.get_overall_buckets](http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html) request
*
... | [
"function",
"buildMlGetOverallBuckets",
"(",
"opts",
")",
"{",
"// eslint-disable-next-line no-unused-vars",
"const",
"{",
"makeRequest",
",",
"ConfigurationError",
",",
"handleError",
",",
"snakeCaseKeys",
"}",
"=",
"opts",
"/**\n * Perform a [ml.get_overall_buckets](http://... | /* eslint camelcase: 0 /* eslint no-unused-vars: 0 | [
"/",
"*",
"eslint",
"camelcase",
":",
"0",
"/",
"*",
"eslint",
"no",
"-",
"unused",
"-",
"vars",
":",
"0"
] | 4fc4699a4d4474d7887bc7757e0269218a859294 | https://github.com/elastic/elasticsearch-js/blob/4fc4699a4d4474d7887bc7757e0269218a859294/api/api/ml.get_overall_buckets.js#L25-L112 | train | Build an ML Get Overall Buckets | [
30522,
3853,
3857,
19968,
18150,
7840,
8095,
24204,
8454,
1006,
23569,
2015,
1007,
1063,
1013,
1013,
9686,
4115,
2102,
1011,
4487,
19150,
1011,
2279,
1011,
2240,
2053,
1011,
15171,
1011,
13075,
2015,
9530,
3367,
1063,
9338,
2063,
15500,
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... |
nhn/tui.editor | src/js/extensions/colorSyntax.js | styleColor | function styleColor(sq, color) {
if (!sq.hasFormat('PRE')) {
if (color === RESET_COLOR) {
sq.changeFormat(null, {
class: 'colour',
tag: 'span'
});
} else {
sq.setTextColour(color);
}
}
} | javascript | function styleColor(sq, color) {
if (!sq.hasFormat('PRE')) {
if (color === RESET_COLOR) {
sq.changeFormat(null, {
class: 'colour',
tag: 'span'
});
} else {
sq.setTextColour(color);
}
}
} | [
"function",
"styleColor",
"(",
"sq",
",",
"color",
")",
"{",
"if",
"(",
"!",
"sq",
".",
"hasFormat",
"(",
"'PRE'",
")",
")",
"{",
"if",
"(",
"color",
"===",
"RESET_COLOR",
")",
"{",
"sq",
".",
"changeFormat",
"(",
"null",
",",
"{",
"class",
":",
... | style color
@param {SquireExt} sq - squire ext instance
@param {string} color - color sting value
@ignore | [
"style",
"color"
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/colorSyntax.js#L126-L137 | train | Style the color of the specified SQ object | [
30522,
3853,
2806,
18717,
1006,
5490,
1010,
3609,
1007,
1063,
2065,
1006,
999,
5490,
1012,
2038,
14192,
4017,
1006,
1005,
3653,
1005,
1007,
1007,
1063,
2065,
1006,
3609,
1027,
1027,
1027,
25141,
1035,
3609,
1007,
1063,
5490,
1012,
2689,
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... |
SheetJS/js-xlsx | xlsx.js | inflate | function inflate(data, usz) {
/* shortcircuit for empty buffer [0x03, 0x00] */
if(data[0] == 3 && !(data[1] & 0x3)) { return [new_raw_buf(usz), 2]; }
/* bit offset */
var boff = 0;
/* header includes final bit and type bits */
var header = 0;
var outbuf = new_unsafe_buf(usz ? usz : (1<<18));
var woff = 0;
v... | javascript | function inflate(data, usz) {
/* shortcircuit for empty buffer [0x03, 0x00] */
if(data[0] == 3 && !(data[1] & 0x3)) { return [new_raw_buf(usz), 2]; }
/* bit offset */
var boff = 0;
/* header includes final bit and type bits */
var header = 0;
var outbuf = new_unsafe_buf(usz ? usz : (1<<18));
var woff = 0;
v... | [
"function",
"inflate",
"(",
"data",
",",
"usz",
")",
"{",
"/* shortcircuit for empty buffer [0x03, 0x00] */",
"if",
"(",
"data",
"[",
"0",
"]",
"==",
"3",
"&&",
"!",
"(",
"data",
"[",
"1",
"]",
"&",
"0x3",
")",
")",
"{",
"return",
"[",
"new_raw_buf",
"... | /* return [ data, bytesRead ] | [
"/",
"*",
"return",
"[",
"data",
"bytesRead",
"]"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L2206-L2283 | train | Inflate a block of data into a raw buffer | [
30522,
3853,
1999,
10258,
3686,
1006,
2951,
1010,
2149,
2480,
1007,
1063,
1013,
1008,
2460,
6895,
11890,
14663,
2005,
4064,
17698,
1031,
1014,
2595,
2692,
2509,
1010,
1014,
2595,
8889,
1033,
1008,
1013,
2065,
1006,
2951,
1031,
1014,
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... |
firebase/firebase-js-sdk | packages/auth/demo/public/script.js | onSignInConfirmPhoneVerification | function onSignInConfirmPhoneVerification() {
var verificationId = $('#signin-phone-verification-id').val();
var verificationCode = $('#signin-phone-verification-code').val();
var credential = firebase.auth.PhoneAuthProvider.credential(
verificationId, verificationCode);
signInOrLinkCredential(credential)... | javascript | function onSignInConfirmPhoneVerification() {
var verificationId = $('#signin-phone-verification-id').val();
var verificationCode = $('#signin-phone-verification-code').val();
var credential = firebase.auth.PhoneAuthProvider.credential(
verificationId, verificationCode);
signInOrLinkCredential(credential)... | [
"function",
"onSignInConfirmPhoneVerification",
"(",
")",
"{",
"var",
"verificationId",
"=",
"$",
"(",
"'#signin-phone-verification-id'",
")",
".",
"val",
"(",
")",
";",
"var",
"verificationCode",
"=",
"$",
"(",
"'#signin-phone-verification-code'",
")",
".",
"val",
... | Confirms a phone number verification for sign-in. | [
"Confirms",
"a",
"phone",
"number",
"verification",
"for",
"sign",
"-",
"in",
"."
] | 491598a499813dacc23724de5e237ec220cc560e | https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/auth/demo/public/script.js#L457-L463 | train | Sign in or link phone verification | [
30522,
3853,
2006,
5332,
29076,
15305,
2078,
27972,
9864,
6299,
9031,
1006,
1007,
1063,
13075,
22616,
3593,
1027,
1002,
1006,
1005,
1001,
3696,
2378,
1011,
3042,
1011,
22616,
1011,
8909,
1005,
1007,
1012,
11748,
1006,
1007,
1025,
13075,
226... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
electron/electron | lib/browser/guest-view-manager.js | function (visibilityState) {
for (const guestInstanceId in guestInstances) {
const guestInstance = guestInstances[guestInstanceId]
guestInstance.visibilityState = visibilityState
if (guestInstance.embedder === embedder) {
guestInstance.guest._sendInternal('ELECTRON_GUEST_INSTANCE_VISIBILIT... | javascript | function (visibilityState) {
for (const guestInstanceId in guestInstances) {
const guestInstance = guestInstances[guestInstanceId]
guestInstance.visibilityState = visibilityState
if (guestInstance.embedder === embedder) {
guestInstance.guest._sendInternal('ELECTRON_GUEST_INSTANCE_VISIBILIT... | [
"function",
"(",
"visibilityState",
")",
"{",
"for",
"(",
"const",
"guestInstanceId",
"in",
"guestInstances",
")",
"{",
"const",
"guestInstance",
"=",
"guestInstances",
"[",
"guestInstanceId",
"]",
"guestInstance",
".",
"visibilityState",
"=",
"visibilityState",
"if... | Forward embedder window visiblity change events to guest | [
"Forward",
"embedder",
"window",
"visiblity",
"change",
"events",
"to",
"guest"
] | 6e29611788277729647acf465f10db1ea6f15788 | https://github.com/electron/electron/blob/6e29611788277729647acf465f10db1ea6f15788/lib/browser/guest-view-manager.js#L299-L307 | train | set visibility state of guest instances | [
30522,
3853,
1006,
16476,
9153,
2618,
1007,
1063,
2005,
1006,
9530,
3367,
4113,
7076,
26897,
3593,
1999,
4113,
7076,
26897,
2015,
1007,
1063,
9530,
3367,
4113,
7076,
26897,
1027,
4113,
7076,
26897,
2015,
1031,
4113,
7076,
26897,
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... | |
graphql/graphql-js | src/validation/rules/FieldsOnCorrectType.js | getSuggestedFieldNames | function getSuggestedFieldNames(
schema: GraphQLSchema,
type: GraphQLOutputType,
fieldName: string,
): Array<string> {
if (isObjectType(type) || isInterfaceType(type)) {
const possibleFieldNames = Object.keys(type.getFields());
return suggestionList(fieldName, possibleFieldNames);
}
// Otherwise, mu... | javascript | function getSuggestedFieldNames(
schema: GraphQLSchema,
type: GraphQLOutputType,
fieldName: string,
): Array<string> {
if (isObjectType(type) || isInterfaceType(type)) {
const possibleFieldNames = Object.keys(type.getFields());
return suggestionList(fieldName, possibleFieldNames);
}
// Otherwise, mu... | [
"function",
"getSuggestedFieldNames",
"(",
"schema",
":",
"GraphQLSchema",
",",
"type",
":",
"GraphQLOutputType",
",",
"fieldName",
":",
"string",
",",
")",
":",
"Array",
"<",
"string",
">",
"{",
"if",
"(",
"isObjectType",
"(",
"type",
")",
"||",
"isInterfac... | For the field name provided, determine if there are any similar field names
that may be the result of a typo. | [
"For",
"the",
"field",
"name",
"provided",
"determine",
"if",
"there",
"are",
"any",
"similar",
"field",
"names",
"that",
"may",
"be",
"the",
"result",
"of",
"a",
"typo",
"."
] | b65ff6db8893c1c68f0f236c4b2d663e6c55f5ef | https://github.com/graphql/graphql-js/blob/b65ff6db8893c1c68f0f236c4b2d663e6c55f5ef/src/validation/rules/FieldsOnCorrectType.js#L132-L143 | train | Returns an array of field names that are not part of the union type. | [
30522,
3853,
4152,
15916,
8449,
3064,
3790,
18442,
2015,
1006,
8040,
28433,
1024,
10629,
4160,
4877,
5403,
2863,
1010,
2828,
1024,
10629,
4160,
23743,
25856,
4904,
13874,
1010,
2492,
18442,
1024,
30524,
4874,
1012,
6309,
1006,
2828,
1012,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/angular | shims_for_IE.js | makeTypedArray | function makeTypedArray(elementSize, pack, unpack) {
// Each TypedArray type requires a distinct constructor instance with
// identical logic, which this produces.
var TypedArray = function() {
Object.defineProperty(this, 'constructor', {value: TypedArray});
$TypedArray$.apply(this, ar... | javascript | function makeTypedArray(elementSize, pack, unpack) {
// Each TypedArray type requires a distinct constructor instance with
// identical logic, which this produces.
var TypedArray = function() {
Object.defineProperty(this, 'constructor', {value: TypedArray});
$TypedArray$.apply(this, ar... | [
"function",
"makeTypedArray",
"(",
"elementSize",
",",
"pack",
",",
"unpack",
")",
"{",
"// Each TypedArray type requires a distinct constructor instance with",
"// identical logic, which this produces.",
"var",
"TypedArray",
"=",
"function",
"(",
")",
"{",
"Object",
".",
"... | %TypedArray%.prototype.toLocaleString ( ) %TypedArray%.prototype.toString ( ) %TypedArray%.prototype.values ( ) %TypedArray%.prototype [ @@iterator ] ( ) get %TypedArray%.prototype [ @@toStringTag ] -- defined in es6.js to shim browsers w/ native TypedArrays | [
"%TypedArray%",
".",
"prototype",
".",
"toLocaleString",
"(",
")",
"%TypedArray%",
".",
"prototype",
".",
"toString",
"(",
")",
"%TypedArray%",
".",
"prototype",
".",
"values",
"(",
")",
"%TypedArray%",
".",
"prototype",
"["
] | c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c | https://github.com/angular/angular/blob/c016e2c4ecf7529f08fae4ca0f5c8b0170c6b51c/shims_for_IE.js#L993-L1020 | train | Creates a TypedArray instance | [
30522,
3853,
2191,
13874,
7662,
9447,
1006,
3787,
4697,
1010,
5308,
1010,
4895,
23947,
1007,
1063,
1013,
1013,
2169,
21189,
2906,
30524,
9375,
21572,
4842,
3723,
1006,
2023,
1010,
1005,
9570,
2953,
1005,
1010,
1063,
3643,
1024,
21189,
2906,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mui-org/material-ui | packages/material-ui-system/src/merge.js | merge | function merge(acc, item) {
if (!item) {
return acc;
}
return deepmerge(acc, item, {
clone: false, // No need to clone deep, it's way faster.
});
} | javascript | function merge(acc, item) {
if (!item) {
return acc;
}
return deepmerge(acc, item, {
clone: false, // No need to clone deep, it's way faster.
});
} | [
"function",
"merge",
"(",
"acc",
",",
"item",
")",
"{",
"if",
"(",
"!",
"item",
")",
"{",
"return",
"acc",
";",
"}",
"return",
"deepmerge",
"(",
"acc",
",",
"item",
",",
"{",
"clone",
":",
"false",
",",
"// No need to clone deep, it's way faster.",
"}",
... | < 1kb payload overhead when lodash/merge is > 3kb. | [
"<",
"1kb",
"payload",
"overhead",
"when",
"lodash",
"/",
"merge",
"is",
">",
"3kb",
"."
] | 1555e52367835946382fbf2a8f681de71318915d | https://github.com/mui-org/material-ui/blob/1555e52367835946382fbf2a8f681de71318915d/packages/material-ui-system/src/merge.js#L3-L11 | train | Merge the items into the first item | [
30522,
3853,
13590,
1006,
16222,
1010,
8875,
1007,
1063,
2065,
1006,
999,
8875,
1007,
1063,
2709,
16222,
1025,
1065,
2709,
2784,
5017,
3351,
1006,
16222,
1010,
8875,
1010,
1063,
17598,
1024,
6270,
1010,
1013,
1013,
2053,
2342,
2000,
17598,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dequelabs/axe-core | lib/core/utils/get-selector.js | uncommonClasses | function uncommonClasses(node, selectorData) {
// eslint no-loop-func:false
let retVal = [];
let classData = selectorData.classes;
let tagData = selectorData.tags;
if (node.classList) {
Array.from(node.classList).forEach(cl => {
let ind = escapeSelector(cl);
if (classData[ind] < tagData[node.nodeName]) {
... | javascript | function uncommonClasses(node, selectorData) {
// eslint no-loop-func:false
let retVal = [];
let classData = selectorData.classes;
let tagData = selectorData.tags;
if (node.classList) {
Array.from(node.classList).forEach(cl => {
let ind = escapeSelector(cl);
if (classData[ind] < tagData[node.nodeName]) {
... | [
"function",
"uncommonClasses",
"(",
"node",
",",
"selectorData",
")",
"{",
"// eslint no-loop-func:false",
"let",
"retVal",
"=",
"[",
"]",
";",
"let",
"classData",
"=",
"selectorData",
".",
"classes",
";",
"let",
"tagData",
"=",
"selectorData",
".",
"tags",
";... | Given a node and the statistics on class frequency on the page,
return all its uncommon class data sorted in order of decreasing uniqueness
@param {Element} node The node
@param {Object} classData The map of classes to counts
@return {Array} The sorted array of uncommon class data | [
"Given",
"a",
"node",
"and",
"the",
"statistics",
"on",
"class",
"frequency",
"on",
"the",
"page",
"return",
"all",
"its",
"uncommon",
"class",
"data",
"sorted",
"in",
"order",
"of",
"decreasing",
"uniqueness"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/utils/get-selector.js#L156-L175 | train | Returns an array of uncommon classes | [
30522,
3853,
13191,
26266,
2229,
1006,
13045,
1010,
27000,
2850,
2696,
1007,
1063,
1013,
1013,
9686,
4115,
2102,
30524,
13045,
1012,
2465,
9863,
1007,
1063,
9140,
1012,
2013,
1006,
13045,
1012,
2465,
9863,
1007,
1012,
18921,
6776,
1006,
188... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
wuchangming/spy-debugger | buildin_modules/weinre/web/interfaces/interfaces.js | reapplyDisplayStyles | function reapplyDisplayStyles() {
reapplyDisplayStyle(".show-Idl", e_showIdl.checked)
reapplyDisplayStyle(".show-JavaScript", e_showJavaScript.checked)
reapplyDisplayStyle(".show-Java", e_showJava.checked)
} | javascript | function reapplyDisplayStyles() {
reapplyDisplayStyle(".show-Idl", e_showIdl.checked)
reapplyDisplayStyle(".show-JavaScript", e_showJavaScript.checked)
reapplyDisplayStyle(".show-Java", e_showJava.checked)
} | [
"function",
"reapplyDisplayStyles",
"(",
")",
"{",
"reapplyDisplayStyle",
"(",
"\".show-Idl\"",
",",
"e_showIdl",
".",
"checked",
")",
"reapplyDisplayStyle",
"(",
"\".show-JavaScript\"",
",",
"e_showJavaScript",
".",
"checked",
")",
"reapplyDisplayStyle",
"(",
"\".show-... | ----------------------------------------------------------------------------- | [
"-----------------------------------------------------------------------------"
] | 55c1dda0dff0c44920673711656ddfd7ff03c307 | https://github.com/wuchangming/spy-debugger/blob/55c1dda0dff0c44920673711656ddfd7ff03c307/buildin_modules/weinre/web/interfaces/interfaces.js#L90-L94 | train | reapply display styles | [
30522,
3853,
2128,
29098,
2135,
10521,
13068,
21756,
4244,
1006,
1007,
1063,
2128,
29098,
2135,
10521,
13068,
21756,
2571,
1006,
1000,
1012,
2265,
1011,
8909,
2140,
1000,
1010,
1041,
1035,
2265,
3593,
2140,
1012,
7039,
1007,
2128,
29098,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/utils/StringMatch.js | multiFieldSort | function multiFieldSort(searchResults, fieldSpec) {
// Move field names into an array, with primary field first
var comparisons;
if (Array.isArray(fieldSpec)) {
comparisons = fieldSpec;
} else {
// TODO Deprecate this form of calling this function
comp... | javascript | function multiFieldSort(searchResults, fieldSpec) {
// Move field names into an array, with primary field first
var comparisons;
if (Array.isArray(fieldSpec)) {
comparisons = fieldSpec;
} else {
// TODO Deprecate this form of calling this function
comp... | [
"function",
"multiFieldSort",
"(",
"searchResults",
",",
"fieldSpec",
")",
"{",
"// Move field names into an array, with primary field first",
"var",
"comparisons",
";",
"if",
"(",
"Array",
".",
"isArray",
"(",
"fieldSpec",
")",
")",
"{",
"comparisons",
"=",
"fieldSpe... | Sorts an array of SearchResult objects on a primary field, followed by secondary fields
in case of ties. 'fieldSpec' provides the priority order for fields, where the first entry is the primary field, for example:
multiFieldSort(bugList, [ "milestone", "severity" ]);
Would sort a bug list by milestone, and within each ... | [
"Sorts",
"an",
"array",
"of",
"SearchResult",
"objects",
"on",
"a",
"primary",
"field",
"followed",
"by",
"secondary",
"fields",
"in",
"case",
"of",
"ties",
".",
"fieldSpec",
"provides",
"the",
"priority",
"order",
"for",
"fields",
"where",
"the",
"first",
"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/StringMatch.js#L850-L890 | train | Sort the search results by the field spec | [
30522,
3853,
4800,
15155,
11589,
1006,
3945,
6072,
11314,
2015,
1010,
4249,
5051,
2278,
1007,
1063,
1013,
1013,
2693,
2492,
3415,
2046,
2019,
9140,
1010,
2007,
3078,
2492,
2034,
13075,
18539,
1025,
2065,
1006,
9140,
1012,
18061,
11335,
2100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
react-bootstrap/react-bootstrap | src/utils/ElementChildren.js | map | function map(children, func) {
let index = 0;
return React.Children.map(children, child =>
React.isValidElement(child) ? func(child, index++) : child,
);
} | javascript | function map(children, func) {
let index = 0;
return React.Children.map(children, child =>
React.isValidElement(child) ? func(child, index++) : child,
);
} | [
"function",
"map",
"(",
"children",
",",
"func",
")",
"{",
"let",
"index",
"=",
"0",
";",
"return",
"React",
".",
"Children",
".",
"map",
"(",
"children",
",",
"child",
"=>",
"React",
".",
"isValidElement",
"(",
"child",
")",
"?",
"func",
"(",
"child... | Iterates through children that are typically specified as `props.children`,
but only maps over children that are "valid elements".
The mapFunction provided index will be normalised to the components mapped,
so an invalid component would not increase the index. | [
"Iterates",
"through",
"children",
"that",
"are",
"typically",
"specified",
"as",
"props",
".",
"children",
"but",
"only",
"maps",
"over",
"children",
"that",
"are",
"valid",
"elements",
"."
] | f0dc81f91ae90eb54bd1e4c04fa9419872d347dc | https://github.com/react-bootstrap/react-bootstrap/blob/f0dc81f91ae90eb54bd1e4c04fa9419872d347dc/src/utils/ElementChildren.js#L11-L17 | train | Map a list of children to a function. | [
30522,
3853,
4949,
1006,
2336,
1010,
4569,
2278,
1007,
1063,
2292,
5950,
1027,
1014,
1025,
2709,
10509,
1012,
2336,
1012,
4949,
1006,
2336,
1010,
2775,
1027,
1028,
10509,
1012,
2003,
10175,
5178,
16930,
4765,
1006,
2775,
1007,
1029,
4569,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Microsoft/vscode | build/lib/treeshaking.js | createTypeScriptLanguageService | function createTypeScriptLanguageService(options) {
// Discover referenced files
const FILES = discoverAndReadFiles(options);
// Add fake usage files
options.inlineEntryPoints.forEach((inlineEntryPoint, index) => {
FILES[`inlineEntryPoint.${index}.ts`] = inlineEntryPoint;
});
// Add addi... | javascript | function createTypeScriptLanguageService(options) {
// Discover referenced files
const FILES = discoverAndReadFiles(options);
// Add fake usage files
options.inlineEntryPoints.forEach((inlineEntryPoint, index) => {
FILES[`inlineEntryPoint.${index}.ts`] = inlineEntryPoint;
});
// Add addi... | [
"function",
"createTypeScriptLanguageService",
"(",
"options",
")",
"{",
"// Discover referenced files",
"const",
"FILES",
"=",
"discoverAndReadFiles",
"(",
"options",
")",
";",
"// Add fake usage files",
"options",
".",
"inlineEntryPoints",
".",
"forEach",
"(",
"(",
"i... | #region Discovery, LanguageService & Setup | [
"#region",
"Discovery",
"LanguageService",
"&",
"Setup"
] | 693a13cd32c5be798051edc0cb43e1e39fc456d9 | https://github.com/Microsoft/vscode/blob/693a13cd32c5be798051edc0cb43e1e39fc456d9/build/lib/treeshaking.js#L54-L75 | train | Creates a TypeScript language service | [
30522,
3853,
3443,
13874,
22483,
25023,
6692,
8449,
2121,
7903,
2063,
1006,
7047,
1007,
1063,
1013,
1013,
7523,
14964,
6764,
9530,
3367,
6764,
1027,
7523,
5685,
16416,
20952,
9463,
2015,
1006,
7047,
1007,
1025,
1013,
1013,
5587,
8275,
8192,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/language/CSSUtils.js | findMatchingRules | function findMatchingRules(selector, htmlDocument) {
var result = new $.Deferred(),
resultSelectors = [];
// Synchronously search for matches in <style> blocks
if (htmlDocument) {
_findMatchingRulesInStyleBlocks(htmlDocument, selector, resultSelectors);
... | javascript | function findMatchingRules(selector, htmlDocument) {
var result = new $.Deferred(),
resultSelectors = [];
// Synchronously search for matches in <style> blocks
if (htmlDocument) {
_findMatchingRulesInStyleBlocks(htmlDocument, selector, resultSelectors);
... | [
"function",
"findMatchingRules",
"(",
"selector",
",",
"htmlDocument",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"resultSelectors",
"=",
"[",
"]",
";",
"// Synchronously search for matches in <style> blocks",
"if",
"(",
"htmlDocum... | Return all rules matching the specified selector.
For now, we only look at the rightmost simple selector. For example, searching for ".foo" will
match these rules:
.foo {}
div .foo {}
div.foo {}
div .foo[bar="42"] {}
div .foo:hovered {}
div .foo::first-child
but will *not* match these rules:
.foobar {}
.foo .bar {}
div... | [
"Return",
"all",
"rules",
"matching",
"the",
"specified",
"selector",
".",
"For",
"now",
"we",
"only",
"look",
"at",
"the",
"rightmost",
"simple",
"selector",
".",
"For",
"example",
"searching",
"for",
".",
"foo",
"will",
"match",
"these",
"rules",
":",
".... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CSSUtils.js#L1501-L1521 | train | Find matching rules in the specified selector | [
30522,
3853,
2424,
18900,
8450,
6820,
4244,
1006,
27000,
1010,
16129,
3527,
24894,
4765,
1007,
1063,
13075,
2765,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1010,
3463,
12260,
24817,
1027,
1031,
1033,
1025,
1013,
1013,
26351,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ecomfe/zrender | src/core/PathProxy.js | function (data) {
var len = data.length;
if (!(this.data && this.data.length === len) && hasTypedArray) {
this.data = new Float32Array(len);
}
for (var i = 0; i < len; i++) {
this.data[i] = data[i];
}
this._len = len;
} | javascript | function (data) {
var len = data.length;
if (!(this.data && this.data.length === len) && hasTypedArray) {
this.data = new Float32Array(len);
}
for (var i = 0; i < len; i++) {
this.data[i] = data[i];
}
this._len = len;
} | [
"function",
"(",
"data",
")",
"{",
"var",
"len",
"=",
"data",
".",
"length",
";",
"if",
"(",
"!",
"(",
"this",
".",
"data",
"&&",
"this",
".",
"data",
".",
"length",
"===",
"len",
")",
"&&",
"hasTypedArray",
")",
"{",
"this",
".",
"data",
"=",
... | 直接设置 Path 数据 | [
"直接设置",
"Path",
"数据"
] | 30321b57cba3149c30eacb0c1e18276f0f001b9f | https://github.com/ecomfe/zrender/blob/30321b57cba3149c30eacb0c1e18276f0f001b9f/src/core/PathProxy.js#L337-L350 | train | Encapsulates the data of a log record | [
30522,
3853,
1006,
2951,
1007,
1063,
13075,
18798,
1027,
2951,
1012,
3091,
1025,
2065,
1006,
999,
1006,
2023,
1012,
2951,
1004,
1004,
2023,
1012,
2951,
1012,
3091,
1027,
1027,
1027,
18798,
1007,
1004,
1004,
27151,
5669,
2906,
9447,
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.ux3/src/sap/ui/ux3/ToolPopup.js | function () {
this._proxyFixSize();
if (!this._sInitialFocusId) {
var sInitFocusId = _fnGetInitialFocus(this);
// Compare the initial focus id with the current focus that is
// stored in the FocusHandler in the core.
... | javascript | function () {
this._proxyFixSize();
if (!this._sInitialFocusId) {
var sInitFocusId = _fnGetInitialFocus(this);
// Compare the initial focus id with the current focus that is
// stored in the FocusHandler in the core.
... | [
"function",
"(",
")",
"{",
"this",
".",
"_proxyFixSize",
"(",
")",
";",
"if",
"(",
"!",
"this",
".",
"_sInitialFocusId",
")",
"{",
"var",
"sInitFocusId",
"=",
"_fnGetInitialFocus",
"(",
"this",
")",
";",
"// Compare the initial focus id with the current focus that... | Function is called via 'jQuery.proxy()' when the ToolPopup has been opened
including the fade-in-animation of the Popup
@private | [
"Function",
"is",
"called",
"via",
"jQuery",
".",
"proxy",
"()",
"when",
"the",
"ToolPopup",
"has",
"been",
"opened",
"including",
"the",
"fade",
"-",
"in",
"-",
"animation",
"of",
"the",
"Popup"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ToolPopup.js#L568-L594 | train | This method is called when the toolPopup is opened. | [
30522,
3853,
1006,
1007,
1063,
2023,
1012,
1035,
24540,
8873,
2595,
5332,
4371,
1006,
1007,
1025,
2065,
1006,
999,
2023,
1012,
1035,
8254,
29050,
10270,
10085,
2271,
3593,
1007,
1063,
13075,
8254,
4183,
14876,
7874,
3593,
1027,
1035,
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... | |
angular/material | src/core/services/interimElement/interimElement.js | addPreset | function addPreset(name, definition) {
definition = definition || {};
definition.methods = definition.methods || [];
definition.options = definition.options || function() { return {}; };
if (/^cancel|hide|show$/.test(name)) {
throw new Error("Preset '" + name + "' in " + interimFactoryN... | javascript | function addPreset(name, definition) {
definition = definition || {};
definition.methods = definition.methods || [];
definition.options = definition.options || function() { return {}; };
if (/^cancel|hide|show$/.test(name)) {
throw new Error("Preset '" + name + "' in " + interimFactoryN... | [
"function",
"addPreset",
"(",
"name",
",",
"definition",
")",
"{",
"definition",
"=",
"definition",
"||",
"{",
"}",
";",
"definition",
".",
"methods",
"=",
"definition",
".",
"methods",
"||",
"[",
"]",
";",
"definition",
".",
"options",
"=",
"definition",
... | Save the configured preset to be used when the factory is instantiated | [
"Save",
"the",
"configured",
"preset",
"to",
"be",
"used",
"when",
"the",
"factory",
"is",
"instantiated"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/interimElement/interimElement.js#L83-L100 | train | Add a preset to the provider config | [
30522,
3853,
5587,
28994,
3388,
1006,
2171,
1010,
6210,
1007,
1063,
6210,
1027,
6210,
1064,
1064,
1063,
1065,
1025,
6210,
1012,
4725,
1027,
6210,
1012,
4725,
1064,
1064,
1031,
1033,
1025,
6210,
1012,
7047,
1027,
6210,
1012,
7047,
1064,
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... |
emberjs/ember.js | packages/@ember/engine/index.js | resolverFor | function resolverFor(namespace) {
let ResolverClass = get(namespace, 'Resolver') || DefaultResolver;
let props = { namespace };
return ResolverClass.create(props);
} | javascript | function resolverFor(namespace) {
let ResolverClass = get(namespace, 'Resolver') || DefaultResolver;
let props = { namespace };
return ResolverClass.create(props);
} | [
"function",
"resolverFor",
"(",
"namespace",
")",
"{",
"let",
"ResolverClass",
"=",
"get",
"(",
"namespace",
",",
"'Resolver'",
")",
"||",
"DefaultResolver",
";",
"let",
"props",
"=",
"{",
"namespace",
"}",
";",
"return",
"ResolverClass",
".",
"create",
"(",... | This function defines the default lookup rules for container lookups:
templates are looked up on `Ember.TEMPLATES`
other names are looked up on the application after classifying the name.
For example, `controller:post` looks up `App.PostController` by default.
if the default lookup fails, look for registered classes o... | [
"This",
"function",
"defines",
"the",
"default",
"lookup",
"rules",
"for",
"container",
"lookups",
":"
] | 7ef1d08b7fe44000cf97b3c43566d20337b0683d | https://github.com/emberjs/ember.js/blob/7ef1d08b7fe44000cf97b3c43566d20337b0683d/packages/@ember/engine/index.js#L454-L458 | train | Creates a new Resolver instance for the given namespace. | [
30522,
3853,
10663,
12881,
2953,
1006,
3415,
15327,
1007,
1063,
2292,
10663,
11890,
27102,
1027,
2131,
1006,
3415,
15327,
1010,
1005,
10663,
2099,
1005,
1007,
1064,
1064,
12398,
6072,
4747,
6299,
1025,
2292,
24387,
1027,
1063,
3415,
15327,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | javascript/selenium-core/scripts/htmlutils.js | MultiWindowRPCOptimizingEngine | function MultiWindowRPCOptimizingEngine(newFrameName, newDelegateEngine) {
// private
var NO_RESULT = '__NO_NODE_RESULT';
var frameName = newFrameName;
var engine = newDelegateEngine || new JavascriptXPathEngine();
var optimizer = new XPathOptimizer(engine);
function createTestDocument() {
... | javascript | function MultiWindowRPCOptimizingEngine(newFrameName, newDelegateEngine) {
// private
var NO_RESULT = '__NO_NODE_RESULT';
var frameName = newFrameName;
var engine = newDelegateEngine || new JavascriptXPathEngine();
var optimizer = new XPathOptimizer(engine);
function createTestDocument() {
... | [
"function",
"MultiWindowRPCOptimizingEngine",
"(",
"newFrameName",
",",
"newDelegateEngine",
")",
"{",
"// private",
"var",
"NO_RESULT",
"=",
"'__NO_NODE_RESULT'",
";",
"var",
"frameName",
"=",
"newFrameName",
";",
"var",
"engine",
"=",
"newDelegateEngine",
"||",
"new... | /////////////////////////////////////////////////////////////////////////////
Implements XPathEngine.
A non-native XPathEngine that tries to avoid inter-window RPC calls, which
are very expensive for IE. It does this by cloning the document from a
"remote" window to a "local" window, and performing operations on the ... | [
"/////////////////////////////////////////////////////////////////////////////",
"Implements",
"XPathEngine",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/htmlutils.js#L1783-L1935 | train | A multi - window - RPC optimization engine. | [
30522,
3853,
4800,
11101,
5004,
14536,
3597,
13876,
27605,
6774,
13159,
3170,
1006,
2047,
15643,
18442,
1010,
2047,
9247,
29107,
17389,
3070,
3170,
1007,
1063,
1013,
1013,
2797,
13075,
2053,
1035,
2765,
1027,
1005,
1035,
1035,
2053,
1035,
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... |
SeleniumHQ/selenium | javascript/selenium-core/scripts/htmlutils.js | FinderBuilder | function FinderBuilder(newDocument) {
// private
var doc = newDocument;
function buildIdFinder(e) {
if (e.id) {
var id = e.id;
return (function(targetDoc) {
return targetDoc.getElementById(id);
});
}
return null;
}
function ... | javascript | function FinderBuilder(newDocument) {
// private
var doc = newDocument;
function buildIdFinder(e) {
if (e.id) {
var id = e.id;
return (function(targetDoc) {
return targetDoc.getElementById(id);
});
}
return null;
}
function ... | [
"function",
"FinderBuilder",
"(",
"newDocument",
")",
"{",
"// private",
"var",
"doc",
"=",
"newDocument",
";",
"function",
"buildIdFinder",
"(",
"e",
")",
"{",
"if",
"(",
"e",
".",
"id",
")",
"{",
"var",
"id",
"=",
"e",
".",
"id",
";",
"return",
"("... | /////////////////////////////////////////////////////////////////////////////
Builds and returns closures that take a document and return a node. | [
"/////////////////////////////////////////////////////////////////////////////",
"Builds",
"and",
"returns",
"closures",
"that",
"take",
"a",
"document",
"and",
"return",
"a",
"node",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/htmlutils.js#L1369-L1414 | train | Constructor for FinderBuilder | [
30522,
3853,
2424,
2121,
8569,
23891,
2099,
1006,
2047,
3527,
24894,
4765,
1007,
1063,
1013,
1013,
2797,
13075,
9986,
1027,
2047,
3527,
24894,
4765,
1025,
3853,
3857,
3593,
23695,
1006,
1041,
1007,
1063,
2065,
1006,
1041,
1012,
8909,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/editor/EditorManager.js | registerInlineEditProvider | function registerInlineEditProvider(provider, priority) {
if (priority === undefined) {
priority = 0;
}
_insertProviderSorted(_inlineEditProviders, provider, priority);
} | javascript | function registerInlineEditProvider(provider, priority) {
if (priority === undefined) {
priority = 0;
}
_insertProviderSorted(_inlineEditProviders, provider, priority);
} | [
"function",
"registerInlineEditProvider",
"(",
"provider",
",",
"priority",
")",
"{",
"if",
"(",
"priority",
"===",
"undefined",
")",
"{",
"priority",
"=",
"0",
";",
"}",
"_insertProviderSorted",
"(",
"_inlineEditProviders",
",",
"provider",
",",
"priority",
")"... | Registers a new inline editor provider. When Quick Edit is invoked each registered provider is
asked if it wants to provide an inline editor given the current editor and cursor location.
An optional priority parameter is used to give providers with higher priority an opportunity
to provide an inline editor before provi... | [
"Registers",
"a",
"new",
"inline",
"editor",
"provider",
".",
"When",
"Quick",
"Edit",
"is",
"invoked",
"each",
"registered",
"provider",
"is",
"asked",
"if",
"it",
"wants",
"to",
"provide",
"an",
"inline",
"editor",
"given",
"the",
"current",
"editor",
"and... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorManager.js#L392-L397 | train | Register an inline edit provider. | [
30522,
3853,
4236,
2378,
4179,
2098,
4183,
21572,
17258,
2121,
1006,
10802,
1010,
9470,
1007,
1063,
2065,
1006,
9470,
1027,
1027,
1027,
6151,
28344,
1007,
1063,
9470,
1027,
1014,
1025,
1065,
1035,
19274,
21572,
17258,
2545,
15613,
1006,
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... |
uber/deck.gl | modules/core/src/lifecycle/create-props.js | addAsyncPropsToPropPrototype | function addAsyncPropsToPropPrototype(defaultProps, propTypes) {
const defaultValues = {};
const descriptors = {
// Default "resolved" values for async props, returned if value not yet resolved/set.
_asyncPropDefaultValues: {
enumerable: false,
value: defaultValues
},
// Shadowed object... | javascript | function addAsyncPropsToPropPrototype(defaultProps, propTypes) {
const defaultValues = {};
const descriptors = {
// Default "resolved" values for async props, returned if value not yet resolved/set.
_asyncPropDefaultValues: {
enumerable: false,
value: defaultValues
},
// Shadowed object... | [
"function",
"addAsyncPropsToPropPrototype",
"(",
"defaultProps",
",",
"propTypes",
")",
"{",
"const",
"defaultValues",
"=",
"{",
"}",
";",
"const",
"descriptors",
"=",
"{",
"// Default \"resolved\" values for async props, returned if value not yet resolved/set.",
"_asyncPropDef... | Create descriptors for overridable props | [
"Create",
"descriptors",
"for",
"overridable",
"props"
] | a2010448b7f268bbd03617b812334c68a6b9e5b2 | https://github.com/uber/deck.gl/blob/a2010448b7f268bbd03617b812334c68a6b9e5b2/modules/core/src/lifecycle/create-props.js#L165-L194 | train | Add async props to the prototype | [
30522,
3853,
5587,
3022,
6038,
21906,
18981,
16033,
21572,
9397,
21709,
26305,
1006,
12398,
21572,
4523,
1010,
17678,
13874,
2015,
1007,
1063,
9530,
3367,
12398,
10175,
15808,
1027,
1063,
1065,
1025,
9530,
3367,
4078,
23235,
5668,
1027,
1063,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/LiveDevelopment/MultiBrowserImpl/protocol/remote/DocumentObserver.js | _onNodesAdded | function _onNodesAdded(nodes) {
var i;
for (i = 0; i < nodes.length; i++) {
//check for Javascript files
if (Utils.isExternalScript(nodes[i])) {
_transport.send(JSON.stringify({
method: 'ScriptAdded',
src: nodes[i].src
... | javascript | function _onNodesAdded(nodes) {
var i;
for (i = 0; i < nodes.length; i++) {
//check for Javascript files
if (Utils.isExternalScript(nodes[i])) {
_transport.send(JSON.stringify({
method: 'ScriptAdded',
src: nodes[i].src
... | [
"function",
"_onNodesAdded",
"(",
"nodes",
")",
"{",
"var",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"nodes",
".",
"length",
";",
"i",
"++",
")",
"{",
"//check for Javascript files",
"if",
"(",
"Utils",
".",
"isExternalScript",
"(",
"nodes",... | /* process related docs added | [
"/",
"*",
"process",
"related",
"docs",
"added"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/protocol/remote/DocumentObserver.js#L231-L246 | train | on nodes added | [
30522,
3853,
1035,
2006,
3630,
6155,
4215,
5732,
1006,
14164,
1007,
1063,
13075,
1045,
1025,
2005,
1006,
1045,
1027,
1014,
1025,
1045,
1026,
14164,
1012,
3091,
1025,
1045,
1009,
1009,
1007,
1063,
1013,
1013,
4638,
2005,
9262,
22483,
6764,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/services/aria/aria.js | MdAriaProvider | function MdAriaProvider() {
var config = {
/** Whether we should show ARIA warnings in the console if labels are missing on the element */
showWarnings: true
};
return {
disableWarnings: disableWarnings,
$get: function($$rAF, $log, $window, $interpolate) {
return MdAriaService.apply(config... | javascript | function MdAriaProvider() {
var config = {
/** Whether we should show ARIA warnings in the console if labels are missing on the element */
showWarnings: true
};
return {
disableWarnings: disableWarnings,
$get: function($$rAF, $log, $window, $interpolate) {
return MdAriaService.apply(config... | [
"function",
"MdAriaProvider",
"(",
")",
"{",
"var",
"config",
"=",
"{",
"/** Whether we should show ARIA warnings in the console if labels are missing on the element */",
"showWarnings",
":",
"true",
"}",
";",
"return",
"{",
"disableWarnings",
":",
"disableWarnings",
",",
"... | @ngdoc service
@name $mdAriaProvider
@module material.core.aria
@description
Modify options of the `$mdAria` service, which will be used by most of the AngularJS Material
components.
You are able to disable `$mdAria` warnings, by using the following markup.
<hljs lang="js">
app.config(function($mdAriaProvider) {
//... | [
"@ngdoc",
"service",
"@name",
"$mdAriaProvider",
"@module",
"material",
".",
"core",
".",
"aria"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/aria/aria.js#L31-L53 | train | AriaProvider provides a provider to use the ARIA warnings. | [
30522,
3853,
9108,
10980,
21572,
17258,
2121,
1006,
1007,
1063,
13075,
9530,
8873,
2290,
1027,
1063,
1013,
1008,
1008,
3251,
2057,
2323,
2265,
9342,
16234,
1999,
1996,
10122,
2065,
10873,
2024,
4394,
2006,
1996,
5783,
1008,
1013,
2265,
9028... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
NetEase/pomelo | lib/components/proxy.js | function(app, opts) {
this.app = app;
this.opts = opts;
this.client = genRpcClient(this.app, opts);
this.app.event.on(events.ADD_SERVERS, this.addServers.bind(this));
this.app.event.on(events.REMOVE_SERVERS, this.removeServers.bind(this));
this.app.event.on(events.REPLACE_SERVERS, this.replaceServers.bind(t... | javascript | function(app, opts) {
this.app = app;
this.opts = opts;
this.client = genRpcClient(this.app, opts);
this.app.event.on(events.ADD_SERVERS, this.addServers.bind(this));
this.app.event.on(events.REMOVE_SERVERS, this.removeServers.bind(this));
this.app.event.on(events.REPLACE_SERVERS, this.replaceServers.bind(t... | [
"function",
"(",
"app",
",",
"opts",
")",
"{",
"this",
".",
"app",
"=",
"app",
";",
"this",
".",
"opts",
"=",
"opts",
";",
"this",
".",
"client",
"=",
"genRpcClient",
"(",
"this",
".",
"app",
",",
"opts",
")",
";",
"this",
".",
"app",
".",
"eve... | Proxy component class
@param {Object} app current application context
@param {Object} opts construct parameters | [
"Proxy",
"component",
"class"
] | defcf019631ed399cc4dad932d3b028a04a039a4 | https://github.com/NetEase/pomelo/blob/defcf019631ed399cc4dad932d3b028a04a039a4/lib/components/proxy.js#L45-L52 | train | Constructor for the Cluster | [
30522,
3853,
1006,
10439,
1010,
23569,
2015,
1007,
1063,
2023,
1012,
10439,
1027,
10439,
1025,
2023,
1012,
23569,
2015,
1027,
23569,
2015,
1025,
2023,
1012,
7396,
1027,
8991,
14536,
9468,
8751,
3372,
1006,
2023,
1012,
10439,
1010,
23569,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js | function(rm, oRoadMap, bStart){
var sType = bStart ? "Start" : "End";
rm.write("<div");
rm.writeAttribute("id", oRoadMap.getId() + "-" + sType);
rm.writeAttribute("tabindex", "-1");
var hasHiddenSteps = true; //Simply assume that there are hidden steps -> updated later (see function updateScrollState)
rm.ad... | javascript | function(rm, oRoadMap, bStart){
var sType = bStart ? "Start" : "End";
rm.write("<div");
rm.writeAttribute("id", oRoadMap.getId() + "-" + sType);
rm.writeAttribute("tabindex", "-1");
var hasHiddenSteps = true; //Simply assume that there are hidden steps -> updated later (see function updateScrollState)
rm.ad... | [
"function",
"(",
"rm",
",",
"oRoadMap",
",",
"bStart",
")",
"{",
"var",
"sType",
"=",
"bStart",
"?",
"\"Start\"",
":",
"\"End\"",
";",
"rm",
".",
"write",
"(",
"\"<div\"",
")",
";",
"rm",
".",
"writeAttribute",
"(",
"\"id\"",
",",
"oRoadMap",
".",
"g... | Writes the delimiter HTML into the rendermanger | [
"Writes",
"the",
"delimiter",
"HTML",
"into",
"the",
"rendermanger"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js#L540-L551 | train | Writes the control to the rendermanger | [
30522,
3853,
1006,
28549,
1010,
20298,
4215,
2863,
2361,
1010,
18667,
7559,
2102,
1007,
1063,
13075,
2358,
18863,
1027,
18667,
7559,
2102,
1029,
1000,
2707,
1000,
1024,
1000,
2203,
1000,
1025,
28549,
1012,
4339,
1006,
1000,
1026,
4487,
2615... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
testing-library/dom-testing-library | src/query-helpers.js | getElementError | function getElementError(message, container) {
return new Error([message, debugDOM(container)].filter(Boolean).join('\n\n'))
} | javascript | function getElementError(message, container) {
return new Error([message, debugDOM(container)].filter(Boolean).join('\n\n'))
} | [
"function",
"getElementError",
"(",
"message",
",",
"container",
")",
"{",
"return",
"new",
"Error",
"(",
"[",
"message",
",",
"debugDOM",
"(",
"container",
")",
"]",
".",
"filter",
"(",
"Boolean",
")",
".",
"join",
"(",
"'\\n\\n'",
")",
")",
"}"
] | /* eslint-enable complexity | [
"/",
"*",
"eslint",
"-",
"enable",
"complexity"
] | fcb2cbcffb7aff6ecff3be8731168c86eee82ce1 | https://github.com/testing-library/dom-testing-library/blob/fcb2cbcffb7aff6ecff3be8731168c86eee82ce1/src/query-helpers.js#L30-L32 | train | Returns an error object for the given element | [
30522,
3853,
2131,
12260,
3672,
2121,
29165,
1006,
4471,
1010,
11661,
1007,
1063,
2709,
2047,
7561,
1006,
1031,
4471,
1010,
2139,
8569,
2290,
9527,
1006,
11661,
1007,
1033,
1012,
11307,
1006,
22017,
20898,
1007,
1012,
3693,
1006,
1005,
1032... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/padding-line-between-statements.js | isIIFEStatement | function isIIFEStatement(node) {
if (node.type === "ExpressionStatement") {
let call = node.expression;
if (call.type === "UnaryExpression") {
call = call.argument;
}
return call.type === "CallExpression" && astUtils.isFunction(call.callee);
}
return false;
} | javascript | function isIIFEStatement(node) {
if (node.type === "ExpressionStatement") {
let call = node.expression;
if (call.type === "UnaryExpression") {
call = call.argument;
}
return call.type === "CallExpression" && astUtils.isFunction(call.callee);
}
return false;
} | [
"function",
"isIIFEStatement",
"(",
"node",
")",
"{",
"if",
"(",
"node",
".",
"type",
"===",
"\"ExpressionStatement\"",
")",
"{",
"let",
"call",
"=",
"node",
".",
"expression",
";",
"if",
"(",
"call",
".",
"type",
"===",
"\"UnaryExpression\"",
")",
"{",
... | Checks the given node is an expression statement of IIFE.
@param {ASTNode} node The node to check.
@returns {boolean} `true` if the node is an expression statement of IIFE.
@private | [
"Checks",
"the",
"given",
"node",
"is",
"an",
"expression",
"statement",
"of",
"IIFE",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/padding-line-between-statements.js#L91-L101 | train | Checks whether a given node is an IIFE statement. | [
30522,
3853,
2003,
6137,
14081,
3686,
3672,
1006,
13045,
1007,
1063,
2065,
1006,
13045,
1012,
2828,
1027,
1027,
1027,
1000,
11423,
12259,
3672,
1000,
1007,
1063,
2292,
2655,
1027,
13045,
1012,
3670,
1025,
2065,
1006,
2655,
1012,
2828,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getsentry/sentry-javascript | packages/raven-js/src/raven.js | function() {
TraceKit.report.uninstall();
this._detachPromiseRejectionHandler();
this._unpatchFunctionToString();
this._restoreBuiltIns();
this._restoreConsole();
Error.stackTraceLimit = this._originalErrorStackTraceLimit;
this._isRavenInstalled = false;
return this;
} | javascript | function() {
TraceKit.report.uninstall();
this._detachPromiseRejectionHandler();
this._unpatchFunctionToString();
this._restoreBuiltIns();
this._restoreConsole();
Error.stackTraceLimit = this._originalErrorStackTraceLimit;
this._isRavenInstalled = false;
return this;
} | [
"function",
"(",
")",
"{",
"TraceKit",
".",
"report",
".",
"uninstall",
"(",
")",
";",
"this",
".",
"_detachPromiseRejectionHandler",
"(",
")",
";",
"this",
".",
"_unpatchFunctionToString",
"(",
")",
";",
"this",
".",
"_restoreBuiltIns",
"(",
")",
";",
"th... | Uninstalls the global error handler.
@return {Raven} | [
"Uninstalls",
"the",
"global",
"error",
"handler",
"."
] | a872223343fecf7364473b78bede937f1eb57bd0 | https://github.com/getsentry/sentry-javascript/blob/a872223343fecf7364473b78bede937f1eb57bd0/packages/raven-js/src/raven.js#L406-L418 | train | uninstalls the raven package | [
30522,
3853,
1006,
1007,
1063,
7637,
23615,
1012,
3189,
1012,
4895,
7076,
9080,
2140,
1006,
1007,
1025,
2023,
1012,
1035,
20010,
6776,
21572,
28732,
2890,
20614,
3258,
11774,
3917,
1006,
1007,
1025,
2023,
1012,
1035,
4895,
4502,
10649,
1126... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/material | src/core/services/layout/layout.js | function(element) {
if (!config.enabled) return angular.noop;
// Re-add the cloak
element.addClass(className);
return function(scope, element) {
// Wait while layout injectors configure, then uncloak
// NOTE: $rAF does not delay enough... and this is a 1... | javascript | function(element) {
if (!config.enabled) return angular.noop;
// Re-add the cloak
element.addClass(className);
return function(scope, element) {
// Wait while layout injectors configure, then uncloak
// NOTE: $rAF does not delay enough... and this is a 1... | [
"function",
"(",
"element",
")",
"{",
"if",
"(",
"!",
"config",
".",
"enabled",
")",
"return",
"angular",
".",
"noop",
";",
"// Re-add the cloak",
"element",
".",
"addClass",
"(",
"className",
")",
";",
"return",
"function",
"(",
"scope",
",",
"element",
... | run after normal ng-cloak | [
"run",
"after",
"normal",
"ng",
"-",
"cloak"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/layout/layout.js#L220-L234 | train | Returns a function that will add the cloak
ether class to the element | [
30522,
3853,
1006,
5783,
1007,
1063,
2065,
1006,
999,
9530,
8873,
2290,
1012,
9124,
1007,
2709,
16108,
1012,
2053,
7361,
1025,
1013,
1013,
2128,
1011,
5587,
1996,
11965,
5783,
1012,
5587,
26266,
1006,
2465,
18442,
1007,
1025,
2709,
3853,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/dom/jquery/Selectors.js | visible | function visible( element ) {
// check if one of the parents (until it's position parent) is invisible
// prevent that elements in static area are always checked as invisible
// list all items until the offsetParent item (with jQuery >1.6 you can use parentsUntil)
var oOffsetParent = jQuery(element).offsetPare... | javascript | function visible( element ) {
// check if one of the parents (until it's position parent) is invisible
// prevent that elements in static area are always checked as invisible
// list all items until the offsetParent item (with jQuery >1.6 you can use parentsUntil)
var oOffsetParent = jQuery(element).offsetPare... | [
"function",
"visible",
"(",
"element",
")",
"{",
"// check if one of the parents (until it's position parent) is invisible",
"// prevent that elements in static area are always checked as invisible",
"// list all items until the offsetParent item (with jQuery >1.6 you can use parentsUntil)",
"var"... | /*!
The following functions are taken from jQuery UI 1.8.17 but modified
Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
http://docs.jquery.com/UI | [
"/",
"*",
"!",
"The",
"following",
"functions",
"are",
"taken",
"from",
"jQuery",
"UI",
"1",
".",
"8",
".",
"17",
"but",
"modified"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/dom/jquery/Selectors.js#L39-L57 | train | Checks if an element is visible | [
30522,
3853,
5710,
1006,
5783,
1007,
1063,
1013,
1013,
4638,
2065,
2028,
1997,
1996,
3008,
1006,
2127,
2009,
1005,
1055,
2597,
6687,
1007,
2003,
8841,
1013,
1013,
4652,
2008,
3787,
1999,
10763,
2181,
2024,
2467,
7039,
2004,
8841,
1013,
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.ux3/src/sap/ui/ux3/NotificationBar.js | function(oEvent) {
var oMN = this.getMessageNotifier();
if (oMN && oMN.getId() === oEvent.getParameter("notifier").getId()) {
oMN.invalidate();
}
} | javascript | function(oEvent) {
var oMN = this.getMessageNotifier();
if (oMN && oMN.getId() === oEvent.getParameter("notifier").getId()) {
oMN.invalidate();
}
} | [
"function",
"(",
"oEvent",
")",
"{",
"var",
"oMN",
"=",
"this",
".",
"getMessageNotifier",
"(",
")",
";",
"if",
"(",
"oMN",
"&&",
"oMN",
".",
"getId",
"(",
")",
"===",
"oEvent",
".",
"getParameter",
"(",
"\"notifier\"",
")",
".",
"getId",
"(",
")",
... | This function is called when the 'messageSelected' event listener was
attached/detached to the MessageNotifier. If the MessageNotifier is
affected it is invalidated accordingly so the inplace message of the
MessageNotifier is clickable or not and has visual features as if it were
clickable. | [
"This",
"function",
"is",
"called",
"when",
"the",
"messageSelected",
"event",
"listener",
"was",
"attached",
"/",
"detached",
"to",
"the",
"MessageNotifier",
".",
"If",
"the",
"MessageNotifier",
"is",
"affected",
"it",
"is",
"invalidated",
"accordingly",
"so",
... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/NotificationBar.js#L718-L724 | train | Handles the event from the notifier | [
30522,
3853,
1006,
1051,
18697,
3372,
1007,
1063,
13075,
18168,
2078,
1027,
2023,
1012,
2131,
7834,
3736,
6914,
4140,
18095,
1006,
1007,
1025,
2065,
1006,
18168,
2078,
1004,
1004,
18168,
2078,
1012,
2131,
3593,
1006,
1007,
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... | |
zloirock/core-js | packages/core-js/modules/es.reflect.set.js | set | function set(target, propertyKey, V /* , receiver */) {
var receiver = arguments.length < 4 ? target : arguments[3];
var ownDescriptor = getOwnPropertyDescriptorModule.f(anObject(target), propertyKey);
var existingDescriptor, prototype;
if (!ownDescriptor) {
if (isObject(prototype = getPrototypeOf(target)))... | javascript | function set(target, propertyKey, V /* , receiver */) {
var receiver = arguments.length < 4 ? target : arguments[3];
var ownDescriptor = getOwnPropertyDescriptorModule.f(anObject(target), propertyKey);
var existingDescriptor, prototype;
if (!ownDescriptor) {
if (isObject(prototype = getPrototypeOf(target)))... | [
"function",
"set",
"(",
"target",
",",
"propertyKey",
",",
"V",
"/* , receiver */",
")",
"{",
"var",
"receiver",
"=",
"arguments",
".",
"length",
"<",
"4",
"?",
"target",
":",
"arguments",
"[",
"3",
"]",
";",
"var",
"ownDescriptor",
"=",
"getOwnPropertyDes... | `Reflect.set` method https://tc39.github.io/ecma262/#sec-reflect.set | [
"Reflect",
".",
"set",
"method",
"https",
":",
"//",
"tc39",
".",
"github",
".",
"io",
"/",
"ecma262",
"/",
"#sec",
"-",
"reflect",
".",
"set"
] | fe7c8511a6d27d03a9b8e075b3351416aae95c58 | https://github.com/zloirock/core-js/blob/fe7c8511a6d27d03a9b8e075b3351416aae95c58/packages/core-js/modules/es.reflect.set.js#L11-L31 | train | Sets a property on an object. | [
30522,
3853,
2275,
1006,
4539,
1010,
3200,
14839,
1010,
1058,
1013,
1008,
1010,
8393,
1008,
1013,
1007,
1063,
13075,
8393,
1027,
9918,
1012,
3091,
1026,
1018,
1029,
4539,
1024,
9918,
1031,
1017,
1033,
1025,
13075,
2219,
6155,
23235,
2953,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mochajs/mocha | lib/reporters/tap.js | TAP | function TAP(runner, options) {
Base.call(this, runner, options);
var self = this;
var n = 1;
var tapVersion = '12';
if (options && options.reporterOptions) {
if (options.reporterOptions.tapVersion) {
tapVersion = options.reporterOptions.tapVersion.toString();
}
}
this._producer = createP... | javascript | function TAP(runner, options) {
Base.call(this, runner, options);
var self = this;
var n = 1;
var tapVersion = '12';
if (options && options.reporterOptions) {
if (options.reporterOptions.tapVersion) {
tapVersion = options.reporterOptions.tapVersion.toString();
}
}
this._producer = createP... | [
"function",
"TAP",
"(",
"runner",
",",
"options",
")",
"{",
"Base",
".",
"call",
"(",
"this",
",",
"runner",
",",
"options",
")",
";",
"var",
"self",
"=",
"this",
";",
"var",
"n",
"=",
"1",
";",
"var",
"tapVersion",
"=",
"'12'",
";",
"if",
"(",
... | Constructs a new `TAP` reporter instance.
@public
@class
@memberof Mocha.reporters
@extends Mocha.reporters.Base
@param {Runner} runner - Instance triggers reporter actions.
@param {Object} [options] - runner options | [
"Constructs",
"a",
"new",
"TAP",
"reporter",
"instance",
"."
] | 9b00fedb610241e33f7592c40164e42a38a793cf | https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/reporters/tap.js#L37-L77 | train | A TAP reporter. | [
30522,
3853,
11112,
1006,
5479,
1010,
7047,
1007,
1063,
2918,
1012,
2655,
1006,
2023,
1010,
5479,
1010,
7047,
1007,
1025,
13075,
2969,
1027,
2023,
1025,
13075,
1050,
1027,
1015,
1025,
13075,
11112,
27774,
1027,
1005,
2260,
1005,
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... |
Dogfalo/materialize | extras/noUiSlider/nouislider.js | handleEntryPoint | function handleEntryPoint ( index, value, that ) {
var percentage;
// Wrap numerical input in an array.
if ( typeof value === "number" ) {
value = [value];
}
// Reject any invalid input, by testing whether value is an array.
if ( Object.prototype.toString.c... | javascript | function handleEntryPoint ( index, value, that ) {
var percentage;
// Wrap numerical input in an array.
if ( typeof value === "number" ) {
value = [value];
}
// Reject any invalid input, by testing whether value is an array.
if ( Object.prototype.toString.c... | [
"function",
"handleEntryPoint",
"(",
"index",
",",
"value",
",",
"that",
")",
"{",
"var",
"percentage",
";",
"// Wrap numerical input in an array.",
"if",
"(",
"typeof",
"value",
"===",
"\"number\"",
")",
"{",
"value",
"=",
"[",
"value",
"]",
";",
"}",
"// R... | Entry parsing | [
"Entry",
"parsing"
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/extras/noUiSlider/nouislider.js#L278-L322 | train | Handle an entry point. | [
30522,
3853,
5047,
4765,
2854,
8400,
1006,
5950,
1010,
3643,
1010,
2008,
1007,
1063,
13075,
7017,
1025,
1013,
1013,
10236,
15973,
7953,
1999,
2019,
9140,
1012,
2065,
1006,
2828,
11253,
3643,
1027,
1027,
1027,
1000,
2193,
1000,
1007,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Microsoft/BotFramework-WebChat | packages/component/src/Attachment/VideoContent.js | parseURL | function parseURL(url) {
let urlLike;
if (typeof URL === 'function') {
urlLike = new URL(url);
} else {
urlLike = document.createElement('a');
urlLike.setAttribute('href', url);
}
const { hostname, pathname, search } = urlLike;
return { hostname, pathname, search };
} | javascript | function parseURL(url) {
let urlLike;
if (typeof URL === 'function') {
urlLike = new URL(url);
} else {
urlLike = document.createElement('a');
urlLike.setAttribute('href', url);
}
const { hostname, pathname, search } = urlLike;
return { hostname, pathname, search };
} | [
"function",
"parseURL",
"(",
"url",
")",
"{",
"let",
"urlLike",
";",
"if",
"(",
"typeof",
"URL",
"===",
"'function'",
")",
"{",
"urlLike",
"=",
"new",
"URL",
"(",
"url",
")",
";",
"}",
"else",
"{",
"urlLike",
"=",
"document",
".",
"createElement",
"(... | This is a workaround - Today, there is no good URL polyfill for older browser - Instead of writing a URL parser, for older browser, we will use this <a href> trick to parse the URL | [
"This",
"is",
"a",
"workaround",
"-",
"Today",
"there",
"is",
"no",
"good",
"URL",
"polyfill",
"for",
"older",
"browser",
"-",
"Instead",
"of",
"writing",
"a",
"URL",
"parser",
"for",
"older",
"browser",
"we",
"will",
"use",
"this",
"<a",
"href",
">",
... | 8bc934d3d07d1ca901d52b5e3a9481fddcdbd91e | https://github.com/Microsoft/BotFramework-WebChat/blob/8bc934d3d07d1ca901d52b5e3a9481fddcdbd91e/packages/component/src/Attachment/VideoContent.js#L17-L30 | train | Parse a URL | [
30522,
3853,
11968,
3366,
3126,
2140,
1006,
24471,
2140,
1007,
1063,
2292,
24471,
6894,
3489,
1025,
2065,
1006,
2828,
11253,
24471,
2140,
1027,
1027,
1027,
1005,
3853,
1005,
1007,
1063,
24471,
6894,
3489,
1027,
2047,
24471,
2140,
1006,
2447... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
facebook/relay | packages/relay-compiler/transforms/RelayRelayDirectiveTransform.js | relayRelayDirectiveTransform | function relayRelayDirectiveTransform(
context: CompilerContext,
): CompilerContext {
return IRTransformer.transform(context, {
Fragment: visitRelayMetadata(fragmentMetadata),
FragmentSpread: visitRelayMetadata(fragmentSpreadMetadata),
});
} | javascript | function relayRelayDirectiveTransform(
context: CompilerContext,
): CompilerContext {
return IRTransformer.transform(context, {
Fragment: visitRelayMetadata(fragmentMetadata),
FragmentSpread: visitRelayMetadata(fragmentSpreadMetadata),
});
} | [
"function",
"relayRelayDirectiveTransform",
"(",
"context",
":",
"CompilerContext",
",",
")",
":",
"CompilerContext",
"{",
"return",
"IRTransformer",
".",
"transform",
"(",
"context",
",",
"{",
"Fragment",
":",
"visitRelayMetadata",
"(",
"fragmentMetadata",
")",
","... | A transform that extracts `@relay(plural: Boolean)` directives and converts
them to metadata that can be accessed at runtime. | [
"A",
"transform",
"that",
"extracts"
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-compiler/transforms/RelayRelayDirectiveTransform.js#L47-L54 | train | Transform a relay directive | [
30522,
3853,
8846,
16570,
4710,
4305,
2890,
15277,
6494,
3619,
14192,
1006,
6123,
1024,
21624,
8663,
18209,
1010,
1007,
1024,
21624,
8663,
18209,
1063,
2709,
20868,
6494,
3619,
14192,
2121,
1012,
10938,
1006,
6123,
1010,
1063,
15778,
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... |
moment/luxon | src/datetime.js | adjustTime | function adjustTime(inst, dur) {
const oPre = inst.o,
year = inst.c.year + dur.years,
month = inst.c.month + dur.months + dur.quarters * 3,
c = Object.assign({}, inst.c, {
year,
month,
day: Math.min(inst.c.day, daysInMonth(year, month)) + dur.days + dur.weeks * 7
}),
millisToAdd ... | javascript | function adjustTime(inst, dur) {
const oPre = inst.o,
year = inst.c.year + dur.years,
month = inst.c.month + dur.months + dur.quarters * 3,
c = Object.assign({}, inst.c, {
year,
month,
day: Math.min(inst.c.day, daysInMonth(year, month)) + dur.days + dur.weeks * 7
}),
millisToAdd ... | [
"function",
"adjustTime",
"(",
"inst",
",",
"dur",
")",
"{",
"const",
"oPre",
"=",
"inst",
".",
"o",
",",
"year",
"=",
"inst",
".",
"c",
".",
"year",
"+",
"dur",
".",
"years",
",",
"month",
"=",
"inst",
".",
"c",
".",
"month",
"+",
"dur",
".",
... | create a new DT instance by adding a duration, adjusting for DSTs | [
"create",
"a",
"new",
"DT",
"instance",
"by",
"adding",
"a",
"duration",
"adjusting",
"for",
"DSTs"
] | 236f2badea297ee73421aa39a83e06177c1be6d0 | https://github.com/moment/luxon/blob/236f2badea297ee73421aa39a83e06177c1be6d0/src/datetime.js#L123-L149 | train | Adjusts the time of an instance to match the given time duration | [
30522,
3853,
14171,
7292,
1006,
16021,
2102,
1010,
4241,
2099,
1007,
1063,
9530,
3367,
6728,
2890,
1027,
16021,
2102,
1012,
1051,
1010,
2095,
1027,
16021,
2102,
1012,
1039,
1012,
2095,
1009,
4241,
2099,
1012,
2086,
1010,
3204,
1027,
16021,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fex-team/webuploader | src/widgets/md5.js | function( file, start, end ) {
var md5 = new Md5(),
deferred = Base.Deferred(),
blob = (file instanceof Blob) ? file :
this.request( 'get-file', file ).source;
md5.on( 'progress load', function( e ) {
e = e || {};
... | javascript | function( file, start, end ) {
var md5 = new Md5(),
deferred = Base.Deferred(),
blob = (file instanceof Blob) ? file :
this.request( 'get-file', file ).source;
md5.on( 'progress load', function( e ) {
e = e || {};
... | [
"function",
"(",
"file",
",",
"start",
",",
"end",
")",
"{",
"var",
"md5",
"=",
"new",
"Md5",
"(",
")",
",",
"deferred",
"=",
"Base",
".",
"Deferred",
"(",
")",
",",
"blob",
"=",
"(",
"file",
"instanceof",
"Blob",
")",
"?",
"file",
":",
"this",
... | 计算文件 md5 值,返回一个 promise 对象,可以监听 progress 进度。
@method md5File
@grammar md5File( file[, start[, end]] ) => promise
@for Uploader
@example
uploader.on( 'fileQueued', function( file ) {
var $li = ...;
uploader.md5File( file )
// 及时显示进度
.progress(function(percentage) {
console.log('Percentage:', percentage);
})
// 完成
... | [
"计算文件",
"md5",
"值,返回一个",
"promise",
"对象,可以监听",
"progress",
"进度。"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/src/widgets/md5.js#L42-L73 | train | Get the content of a file | [
30522,
3853,
1006,
5371,
1010,
2707,
1010,
2203,
1007,
1063,
13075,
9108,
2629,
1027,
2047,
9108,
2629,
1006,
1007,
1010,
13366,
28849,
2094,
1027,
2918,
1012,
13366,
28849,
2094,
1006,
1007,
1010,
1038,
4135,
2497,
1027,
1006,
5371,
6013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
mochajs/mocha | lib/reporters/tap.js | println | function println(format, varArgs) {
var vargs = Array.from(arguments);
vargs[0] += '\n';
process.stdout.write(sprintf.apply(null, vargs));
} | javascript | function println(format, varArgs) {
var vargs = Array.from(arguments);
vargs[0] += '\n';
process.stdout.write(sprintf.apply(null, vargs));
} | [
"function",
"println",
"(",
"format",
",",
"varArgs",
")",
"{",
"var",
"vargs",
"=",
"Array",
".",
"from",
"(",
"arguments",
")",
";",
"vargs",
"[",
"0",
"]",
"+=",
"'\\n'",
";",
"process",
".",
"stdout",
".",
"write",
"(",
"sprintf",
".",
"apply",
... | Writes newline-terminated formatted string to reporter output stream.
@private
@param {string} format - `printf`-like format string
@param {...*} [varArgs] - Format string arguments | [
"Writes",
"newline",
"-",
"terminated",
"formatted",
"string",
"to",
"reporter",
"output",
"stream",
"."
] | 9b00fedb610241e33f7592c40164e42a38a793cf | https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/reporters/tap.js#L102-L106 | train | Print a string to the console. | [
30522,
3853,
6140,
19666,
1006,
4289,
1010,
13075,
2906,
5620,
1007,
1063,
13075,
13075,
5620,
1027,
9140,
1012,
2013,
1006,
9918,
1007,
1025,
13075,
5620,
1031,
1014,
1033,
1009,
1027,
1005,
1032,
1050,
1005,
1025,
2832,
30524,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/icon/js/iconService.js | function(err) {
var msg = angular.isString(err) ? err : (err.message || err.data || err.statusText);
$log.warn(msg);
reject(err);
} | javascript | function(err) {
var msg = angular.isString(err) ? err : (err.message || err.data || err.statusText);
$log.warn(msg);
reject(err);
} | [
"function",
"(",
"err",
")",
"{",
"var",
"msg",
"=",
"angular",
".",
"isString",
"(",
"err",
")",
"?",
"err",
":",
"(",
"err",
".",
"message",
"||",
"err",
".",
"data",
"||",
"err",
".",
"statusText",
")",
";",
"$log",
".",
"warn",
"(",
"msg",
... | Catch HTTP or generic errors not related to incorrect icon IDs. | [
"Catch",
"HTTP",
"or",
"generic",
"errors",
"not",
"related",
"to",
"incorrect",
"icon",
"IDs",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/icon/js/iconService.js#L642-L646 | train | reject the promise | [
30522,
3853,
1006,
9413,
2099,
1007,
1063,
13075,
5796,
2290,
1027,
16108,
1012,
26354,
18886,
3070,
1006,
9413,
2099,
1007,
1029,
9413,
2099,
1024,
1006,
9413,
2099,
1012,
4471,
1064,
1064,
9413,
2099,
1012,
2951,
1064,
1064,
9413,
2099,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
eslint/eslint | lib/rules/max-lines-per-function.js | isEmbedded | function isEmbedded(node) {
if (!node.parent) {
return false;
}
if (node !== node.parent.value) {
return false;
}
if (node.parent.type === "MethodDefinition") {
return true;
}
if (node.par... | javascript | function isEmbedded(node) {
if (!node.parent) {
return false;
}
if (node !== node.parent.value) {
return false;
}
if (node.parent.type === "MethodDefinition") {
return true;
}
if (node.par... | [
"function",
"isEmbedded",
"(",
"node",
")",
"{",
"if",
"(",
"!",
"node",
".",
"parent",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"node",
"!==",
"node",
".",
"parent",
".",
"value",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"node"... | Identifies is a node is a FunctionExpression which is embedded within a MethodDefinition or Property
@param {ASTNode} node Node to test
@returns {boolean} True if it's a FunctionExpression embedded within a MethodDefinition or Property | [
"Identifies",
"is",
"a",
"node",
"is",
"a",
"FunctionExpression",
"which",
"is",
"embedded",
"within",
"a",
"MethodDefinition",
"or",
"Property"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/max-lines-per-function.js#L146-L160 | train | returns true if node is embedded | [
30522,
3853,
2003,
6633,
8270,
5732,
1006,
13045,
1007,
1063,
2065,
1006,
999,
13045,
1012,
6687,
1007,
1063,
2709,
6270,
1025,
1065,
2065,
1006,
13045,
999,
1027,
1027,
13045,
1012,
6687,
1012,
3643,
1007,
1063,
2709,
6270,
1025,
1065,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.m/src/sap/m/GrowingEnablement.js | function(aContexts, oModel) {
if (!aContexts.length) {
return;
}
var aItems = this._oControl.getItems(true);
for (var i = 0, c = 0, oItem; i < aItems.length; i++) {
oItem = aItems[i];
// group headers are not in binding context
if (!oItem.isGroupHeader()) {
oItem.setBindingContext(aCo... | javascript | function(aContexts, oModel) {
if (!aContexts.length) {
return;
}
var aItems = this._oControl.getItems(true);
for (var i = 0, c = 0, oItem; i < aItems.length; i++) {
oItem = aItems[i];
// group headers are not in binding context
if (!oItem.isGroupHeader()) {
oItem.setBindingContext(aCo... | [
"function",
"(",
"aContexts",
",",
"oModel",
")",
"{",
"if",
"(",
"!",
"aContexts",
".",
"length",
")",
"{",
"return",
";",
"}",
"var",
"aItems",
"=",
"this",
".",
"_oControl",
".",
"getItems",
"(",
"true",
")",
";",
"for",
"(",
"var",
"i",
"=",
... | update context on all items except group headers | [
"update",
"context",
"on",
"all",
"items",
"except",
"group",
"headers"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.m/src/sap/m/GrowingEnablement.js#L368-L382 | train | Sets the binding context of the items in the control | [
30522,
3853,
1006,
9353,
28040,
18413,
2015,
1010,
18168,
10244,
2140,
1007,
1063,
2065,
1006,
999,
9353,
28040,
18413,
2015,
1012,
3091,
1007,
1063,
2709,
1025,
1065,
13075,
9932,
18532,
2015,
1027,
2023,
1012,
1035,
1051,
8663,
13181,
214... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | function(numSt, numCov, numBranch, numCovBr, moduleName) {
var totalPercent = percentage(numCov, numSt);
var statusClass = totalPercent < successRate ? "bl-error" : "bl-success";
var rowTitle = ( moduleName ? "Total for module: " + moduleName : "Global total" );
var totalsOutput = grand... | javascript | function(numSt, numCov, numBranch, numCovBr, moduleName) {
var totalPercent = percentage(numCov, numSt);
var statusClass = totalPercent < successRate ? "bl-error" : "bl-success";
var rowTitle = ( moduleName ? "Total for module: " + moduleName : "Global total" );
var totalsOutput = grand... | [
"function",
"(",
"numSt",
",",
"numCov",
",",
"numBranch",
",",
"numCovBr",
",",
"moduleName",
")",
"{",
"var",
"totalPercent",
"=",
"percentage",
"(",
"numCov",
",",
"numSt",
")",
";",
"var",
"statusClass",
"=",
"totalPercent",
"<",
"successRate",
"?",
"\... | create temporary function for use by the global totals reporter, as well as the per-module totals reporter | [
"create",
"temporary",
"function",
"for",
"use",
"by",
"the",
"global",
"totals",
"reporter",
"as",
"well",
"as",
"the",
"per",
"-",
"module",
"totals",
"reporter"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/blanket.js#L4765-L4779 | train | Add totals to the body | [
30522,
3853,
1006,
16371,
5244,
2102,
1010,
16371,
12458,
4492,
1010,
15903,
5521,
2818,
1010,
16371,
12458,
4492,
19892,
1010,
11336,
18442,
1007,
1063,
13075,
2561,
4842,
13013,
1027,
7017,
1006,
16371,
12458,
4492,
1010,
16371,
5244,
2102,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/MultiRangeInlineEditor.js | SearchResultItem | function SearchResultItem(rangeResult) {
this.name = rangeResult.name;
this.textRange = new TextRange(rangeResult.document, rangeResult.lineStart, rangeResult.lineEnd);
// this.$listItem is assigned in load()
} | javascript | function SearchResultItem(rangeResult) {
this.name = rangeResult.name;
this.textRange = new TextRange(rangeResult.document, rangeResult.lineStart, rangeResult.lineEnd);
// this.$listItem is assigned in load()
} | [
"function",
"SearchResultItem",
"(",
"rangeResult",
")",
"{",
"this",
".",
"name",
"=",
"rangeResult",
".",
"name",
";",
"this",
".",
"textRange",
"=",
"new",
"TextRange",
"(",
"rangeResult",
".",
"document",
",",
"rangeResult",
".",
"lineStart",
",",
"range... | Stores one search result: its source file, line range, etc. plus the DOM node representing it
in the results list.
@constructor | [
"Stores",
"one",
"search",
"result",
":",
"its",
"source",
"file",
"line",
"range",
"etc",
".",
"plus",
"the",
"DOM",
"node",
"representing",
"it",
"in",
"the",
"results",
"list",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/MultiRangeInlineEditor.js#L75-L79 | train | The SearchResultItem class | [
30522,
3853,
3945,
6072,
11314,
4221,
2213,
1006,
11505,
2229,
11314,
1007,
1063,
2023,
1012,
2171,
1027,
11505,
2229,
11314,
1012,
2171,
1025,
2023,
1012,
3793,
24388,
2063,
1027,
2047,
3793,
24388,
2063,
1006,
11505,
2229,
11314,
1012,
62... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/prefer-const.js | getDestructuringHost | function getDestructuringHost(reference) {
if (!reference.isWrite()) {
return null;
}
let node = reference.identifier.parent;
while (PATTERN_TYPE.test(node.type)) {
node = node.parent;
}
if (!DESTRUCTURING_HOST_TYPE.test(node.type)) {
return null;
}
return node;... | javascript | function getDestructuringHost(reference) {
if (!reference.isWrite()) {
return null;
}
let node = reference.identifier.parent;
while (PATTERN_TYPE.test(node.type)) {
node = node.parent;
}
if (!DESTRUCTURING_HOST_TYPE.test(node.type)) {
return null;
}
return node;... | [
"function",
"getDestructuringHost",
"(",
"reference",
")",
"{",
"if",
"(",
"!",
"reference",
".",
"isWrite",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"let",
"node",
"=",
"reference",
".",
"identifier",
".",
"parent",
";",
"while",
"(",
"PATTERN_TY... | Gets the VariableDeclarator/AssignmentExpression node that a given reference
belongs to.
This is used to detect a mix of reassigned and never reassigned in a
destructuring.
@param {eslint-scope.Reference} reference - A reference to get.
@returns {ASTNode|null} A VariableDeclarator/AssignmentExpression node or
null. | [
"Gets",
"the",
"VariableDeclarator",
"/",
"AssignmentExpression",
"node",
"that",
"a",
"given",
"reference",
"belongs",
"to",
".",
"This",
"is",
"used",
"to",
"detect",
"a",
"mix",
"of",
"reassigned",
"and",
"never",
"reassigned",
"in",
"a",
"destructuring",
"... | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/prefer-const.js#L84-L98 | train | Returns the declaration host node of the given reference | [
30522,
3853,
2131,
6155,
18300,
12228,
15006,
2102,
1006,
4431,
1007,
1063,
2065,
1006,
999,
4431,
1012,
2003,
26373,
1006,
1007,
1007,
1063,
2709,
19701,
1025,
1065,
2292,
13045,
1027,
4431,
1012,
8909,
4765,
18095,
1012,
6687,
1025,
2096,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/vue-devtools | src/backend/index.js | bindToConsole | function bindToConsole (instance) {
if (!instance) return
if (!isBrowser) return
const id = instance.__VUE_DEVTOOLS_UID__
const index = consoleBoundInstances.indexOf(id)
if (index > -1) {
consoleBoundInstances.splice(index, 1)
} else {
consoleBoundInstances.pop()
}
consoleBoundInstances.unshif... | javascript | function bindToConsole (instance) {
if (!instance) return
if (!isBrowser) return
const id = instance.__VUE_DEVTOOLS_UID__
const index = consoleBoundInstances.indexOf(id)
if (index > -1) {
consoleBoundInstances.splice(index, 1)
} else {
consoleBoundInstances.pop()
}
consoleBoundInstances.unshif... | [
"function",
"bindToConsole",
"(",
"instance",
")",
"{",
"if",
"(",
"!",
"instance",
")",
"return",
"if",
"(",
"!",
"isBrowser",
")",
"return",
"const",
"id",
"=",
"instance",
".",
"__VUE_DEVTOOLS_UID__",
"const",
"index",
"=",
"consoleBoundInstances",
".",
"... | Binds given instance in console as $vm0.
For compatibility reasons it also binds it as $vm.
@param {Vue} instance | [
"Binds",
"given",
"instance",
"in",
"console",
"as",
"$vm0",
".",
"For",
"compatibility",
"reasons",
"it",
"also",
"binds",
"it",
"as",
"$vm",
"."
] | 4de4b86388453cd07f0c1bf967d43a4dd4b011c9 | https://github.com/vuejs/vue-devtools/blob/4de4b86388453cd07f0c1bf967d43a4dd4b011c9/src/backend/index.js#L900-L917 | train | Bind to console | [
30522,
3853,
14187,
3406,
8663,
19454,
2063,
1006,
6013,
1007,
1063,
2065,
1006,
999,
6013,
1007,
2709,
2065,
1006,
999,
2003,
12618,
9333,
2121,
1007,
2709,
9530,
3367,
8909,
1027,
6013,
1012,
1035,
1035,
24728,
2063,
1035,
16475,
3406,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | summarize | function summarize(desc) {
if ( desc != null ) {
desc = String(desc).replace(/\s+/g, ' ').
replace(/"'/g, '"').
replace(/^(<\/?p>|<br\/?>|\s)+/, '');
var match = /([\w\W]+?\.)[^a-z0-9_$]/i.exec(desc);
return match ? match[1] : desc;
}
} | javascript | function summarize(desc) {
if ( desc != null ) {
desc = String(desc).replace(/\s+/g, ' ').
replace(/"'/g, '"').
replace(/^(<\/?p>|<br\/?>|\s)+/, '');
var match = /([\w\W]+?\.)[^a-z0-9_$]/i.exec(desc);
return match ? match[1] : desc;
}
} | [
"function",
"summarize",
"(",
"desc",
")",
"{",
"if",
"(",
"desc",
"!=",
"null",
")",
"{",
"desc",
"=",
"String",
"(",
"desc",
")",
".",
"replace",
"(",
"/",
"\\s+",
"/",
"g",
",",
"' '",
")",
".",
"replace",
"(",
"/",
"\"'",
"/",
"g",
",",
"... | /*
function isNonEmptyNamespace($) {
return $.isNamespace && (
($.properties && $.properties.length > 0) ||
($.methods && $.methods.length > 0) ||
($.augments && $.augments.length > 0) ||
($.children && $.children.length > 0));
}; /* Just the first sentence (up to a full stop). Should not break on dotted variable names... | [
"/",
"*",
"function",
"isNonEmptyNamespace",
"(",
"$",
")",
"{",
"return",
"$",
".",
"isNamespace",
"&&",
"(",
"(",
"$",
".",
"properties",
"&&",
"$",
".",
"properties",
".",
"length",
">",
"0",
")",
"||",
"(",
"$",
".",
"methods",
"&&",
"$",
".",
... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/lib/jsdoc/ui5/template/publish.js#L1185-L1194 | train | summarize the description of a node | [
30522,
3853,
7680,
7849,
4697,
1006,
4078,
2278,
1007,
1063,
2065,
1006,
4078,
2278,
999,
1027,
19701,
1007,
1063,
4078,
2278,
1027,
5164,
1006,
4078,
2278,
1007,
1012,
5672,
1006,
1013,
1032,
1055,
1009,
1013,
1043,
1010,
1005,
1005,
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... |
eslint/eslint | lib/rules/new-cap.js | extractNameFromExpression | function extractNameFromExpression(node) {
let name = "";
if (node.callee.type === "MemberExpression") {
const property = node.callee.property;
if (property.type === "Literal" && (typeof property.value === "string")) {
name = property.value;... | javascript | function extractNameFromExpression(node) {
let name = "";
if (node.callee.type === "MemberExpression") {
const property = node.callee.property;
if (property.type === "Literal" && (typeof property.value === "string")) {
name = property.value;... | [
"function",
"extractNameFromExpression",
"(",
"node",
")",
"{",
"let",
"name",
"=",
"\"\"",
";",
"if",
"(",
"node",
".",
"callee",
".",
"type",
"===",
"\"MemberExpression\"",
")",
"{",
"const",
"property",
"=",
"node",
".",
"callee",
".",
"property",
";",
... | -------------------------------------------------------------------------- Helpers --------------------------------------------------------------------------
Get exact callee name from expression
@param {ASTNode} node CallExpression or NewExpression node
@returns {string} name | [
"--------------------------------------------------------------------------",
"Helpers",
"--------------------------------------------------------------------------",
"Get",
"exact",
"callee",
"name",
"from",
"expression"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/new-cap.js#L157-L173 | train | Extract the name from a MemberExpression | [
30522,
3853,
14817,
18442,
19699,
8462,
2595,
20110,
3258,
1006,
13045,
1007,
1063,
2292,
2171,
1027,
1000,
1000,
1025,
2065,
1006,
13045,
1012,
2655,
4402,
1012,
2828,
1027,
1027,
1027,
1000,
2266,
10288,
20110,
3258,
1000,
1007,
1063,
953... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ion.rangeSlider/js/ion.rangeSlider.js | function (target, e) {
e.preventDefault();
var x = e.pageX || e.originalEvent.touches && e.originalEvent.touches[0].pageX;
if (e.button === 2) {
return;
}
this.current_plugin = this.plugin_count;
this.target = target;
... | javascript | function (target, e) {
e.preventDefault();
var x = e.pageX || e.originalEvent.touches && e.originalEvent.touches[0].pageX;
if (e.button === 2) {
return;
}
this.current_plugin = this.plugin_count;
this.target = target;
... | [
"function",
"(",
"target",
",",
"e",
")",
"{",
"e",
".",
"preventDefault",
"(",
")",
";",
"var",
"x",
"=",
"e",
".",
"pageX",
"||",
"e",
".",
"originalEvent",
".",
"touches",
"&&",
"e",
".",
"originalEvent",
".",
"touches",
"[",
"0",
"]",
".",
"p... | Mousedown or touchstart
for other slider elements, like diapason line
@param target {String}
@param e {Object} event object | [
"Mousedown",
"or",
"touchstart",
"for",
"other",
"slider",
"elements",
"like",
"diapason",
"line"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/ion.rangeSlider/js/ion.rangeSlider.js#L863-L881 | train | ontouchstart event | [
30522,
3853,
1006,
4539,
1010,
1041,
1007,
1063,
1041,
1012,
4652,
3207,
7011,
11314,
1006,
1007,
1025,
13075,
1060,
1027,
1041,
1012,
3931,
2595,
1064,
1064,
1041,
1012,
2434,
18697,
3372,
1012,
12817,
1004,
1004,
1041,
1012,
2434,
18697,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
electron/electron | lib/browser/api/menu-utils.js | sortTopologically | function sortTopologically (originalOrder, edgesById) {
const sorted = []
const marked = new Set()
const visit = (mark) => {
if (marked.has(mark)) return
marked.add(mark)
const edges = edgesById.get(mark)
if (edges != null) {
edges.forEach(visit)
}
sorted.push(mark)
}
originalO... | javascript | function sortTopologically (originalOrder, edgesById) {
const sorted = []
const marked = new Set()
const visit = (mark) => {
if (marked.has(mark)) return
marked.add(mark)
const edges = edgesById.get(mark)
if (edges != null) {
edges.forEach(visit)
}
sorted.push(mark)
}
originalO... | [
"function",
"sortTopologically",
"(",
"originalOrder",
",",
"edgesById",
")",
"{",
"const",
"sorted",
"=",
"[",
"]",
"const",
"marked",
"=",
"new",
"Set",
"(",
")",
"const",
"visit",
"=",
"(",
"mark",
")",
"=>",
"{",
"if",
"(",
"marked",
".",
"has",
... | Sort nodes topologically using a depth-first approach. Encountered cycles are broken. | [
"Sort",
"nodes",
"topologically",
"using",
"a",
"depth",
"-",
"first",
"approach",
".",
"Encountered",
"cycles",
"are",
"broken",
"."
] | 6e29611788277729647acf465f10db1ea6f15788 | https://github.com/electron/electron/blob/6e29611788277729647acf465f10db1ea6f15788/lib/browser/api/menu-utils.js#L53-L69 | train | Sort the topologically sorted list of nodes in the order given by originalOrder. | [
30522,
3853,
4066,
14399,
10091,
2135,
1006,
2434,
8551,
2121,
1010,
7926,
3762,
3593,
1007,
1063,
9530,
3367,
19616,
1027,
1031,
1033,
9530,
3367,
4417,
1027,
2047,
2275,
1006,
1007,
9530,
3367,
3942,
1027,
1006,
2928,
1007,
1027,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
quasarframework/quasar | ui/src/components/datetime/persian.js | jalCal | function jalCal (jy, withoutLeap) {
let bl = breaks.length,
gy = jy + 621,
leapJ = -14,
jp = breaks[0],
jm,
jump,
leap,
leapG,
march,
n,
i
if (jy < jp || jy >= breaks[bl - 1]) { throw new Error('Invalid Jalaali year ' + jy) }
// Find the limiting years for the Jalaali yea... | javascript | function jalCal (jy, withoutLeap) {
let bl = breaks.length,
gy = jy + 621,
leapJ = -14,
jp = breaks[0],
jm,
jump,
leap,
leapG,
march,
n,
i
if (jy < jp || jy >= breaks[bl - 1]) { throw new Error('Invalid Jalaali year ' + jy) }
// Find the limiting years for the Jalaali yea... | [
"function",
"jalCal",
"(",
"jy",
",",
"withoutLeap",
")",
"{",
"let",
"bl",
"=",
"breaks",
".",
"length",
",",
"gy",
"=",
"jy",
"+",
"621",
",",
"leapJ",
"=",
"-",
"14",
",",
"jp",
"=",
"breaks",
"[",
"0",
"]",
",",
"jm",
",",
"jump",
",",
"l... | /*
This function determines if the Jalaali (Persian) year is
leap (366-day long) or is the common year (365 days), and
finds the day in March (Gregorian calendar) of the first
day of the Jalaali year (jy).
@param jy Jalaali calendar year (-61 to 3177)
@param withoutLeap when don't need leap (true or false) default is ... | [
"/",
"*",
"This",
"function",
"determines",
"if",
"the",
"Jalaali",
"(",
"Persian",
")",
"year",
"is",
"leap",
"(",
"366",
"-",
"day",
"long",
")",
"or",
"is",
"the",
"common",
"year",
"(",
"365",
"days",
")",
"and",
"finds",
"the",
"day",
"in",
"M... | 5d2fb6c96bff6095236f8ca6fe07a037e32e06b3 | https://github.com/quasarframework/quasar/blob/5d2fb6c96bff6095236f8ca6fe07a037e32e06b3/ui/src/components/datetime/persian.js#L105-L155 | train | Returns the Jalaali calendar for the given Jalaali year. | [
30522,
3853,
14855,
15472,
2389,
1006,
1046,
2100,
1010,
2302,
19738,
2361,
1007,
1063,
2292,
1038,
2140,
1027,
7807,
1012,
3091,
1010,
1043,
2100,
1027,
1046,
2100,
1009,
5786,
2487,
1010,
11679,
3501,
1027,
1011,
2403,
1010,
16545,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/LiveDevelopment/LiveDevMultiBrowser.js | setLauncher | function setLauncher(launcher) {
if (!(launcher && launcher.launch)) {
console.log("Invalid launcher object: ", launcher, new Error("LiveDevMultiBrowser.setLauncher()"));
return;
}
_launcher = launcher;
} | javascript | function setLauncher(launcher) {
if (!(launcher && launcher.launch)) {
console.log("Invalid launcher object: ", launcher, new Error("LiveDevMultiBrowser.setLauncher()"));
return;
}
_launcher = launcher;
} | [
"function",
"setLauncher",
"(",
"launcher",
")",
"{",
"if",
"(",
"!",
"(",
"launcher",
"&&",
"launcher",
".",
"launch",
")",
")",
"{",
"console",
".",
"log",
"(",
"\"Invalid launcher object: \"",
",",
"launcher",
",",
"new",
"Error",
"(",
"\"LiveDevMultiBrow... | Sets the current browser launcher mechanism to be used by live development
(e.g., default browser, iframe-based browser, etc.)
The launcher must provide the following method:
- launch(url): Launch the given URL in the appropriate browser.
@param {{launch: function(string)}} launcher | [
"Sets",
"the",
"current",
"browser",
"launcher",
"mechanism",
"to",
"be",
"used",
"by",
"live",
"development",
"(",
"e",
".",
"g",
".",
"default",
"browser",
"iframe",
"-",
"based",
"browser",
"etc",
".",
")",
"The",
"launcher",
"must",
"provide",
"the",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevMultiBrowser.js#L807-L813 | train | Set the launcher object | [
30522,
3853,
2275,
17298,
26091,
2099,
1006,
22742,
1007,
1063,
2065,
1006,
999,
1006,
22742,
1004,
1004,
22742,
1012,
4888,
1007,
1007,
1063,
10122,
1012,
8833,
1006,
1000,
19528,
22742,
4874,
1024,
1000,
1010,
22742,
1010,
2047,
7561,
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... |
SeleniumHQ/selenium | javascript/atoms/events.js | createNativeTouchList | function createNativeTouchList(touchListArgs) {
var touches = goog.array.map(touchListArgs, function(touchArg) {
return doc.createTouch(view, target, touchArg.identifier,
touchArg.pageX, touchArg.pageY, touchArg.screenX, touchArg.screenY);
});
return doc.createTouchList.apply(doc, touches);... | javascript | function createNativeTouchList(touchListArgs) {
var touches = goog.array.map(touchListArgs, function(touchArg) {
return doc.createTouch(view, target, touchArg.identifier,
touchArg.pageX, touchArg.pageY, touchArg.screenX, touchArg.screenY);
});
return doc.createTouchList.apply(doc, touches);... | [
"function",
"createNativeTouchList",
"(",
"touchListArgs",
")",
"{",
"var",
"touches",
"=",
"goog",
".",
"array",
".",
"map",
"(",
"touchListArgs",
",",
"function",
"(",
"touchArg",
")",
"{",
"return",
"doc",
".",
"createTouch",
"(",
"view",
",",
"target",
... | Creates a TouchList, using native touch Api, for touch events. | [
"Creates",
"a",
"TouchList",
"using",
"native",
"touch",
"Api",
"for",
"touch",
"events",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/atoms/events.js#L493-L500 | train | Creates a native touch list. | [
30522,
3853,
3443,
19833,
3512,
24826,
2818,
9863,
1006,
3543,
9863,
2906,
5620,
1007,
1063,
13075,
12817,
1027,
27571,
2290,
1012,
9140,
1012,
4949,
1006,
3543,
9863,
2906,
5620,
1010,
3853,
1006,
3543,
2906,
2290,
1007,
1063,
2709,
9986,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/util/npm-utils.js | fetchPeerDependencies | function fetchPeerDependencies(packageName) {
const npmProcess = spawn.sync(
"npm",
["show", "--json", packageName, "peerDependencies"],
{ encoding: "utf8" }
);
const error = npmProcess.error;
if (error && error.code === "ENOENT") {
return null;
}
const fetchedT... | javascript | function fetchPeerDependencies(packageName) {
const npmProcess = spawn.sync(
"npm",
["show", "--json", packageName, "peerDependencies"],
{ encoding: "utf8" }
);
const error = npmProcess.error;
if (error && error.code === "ENOENT") {
return null;
}
const fetchedT... | [
"function",
"fetchPeerDependencies",
"(",
"packageName",
")",
"{",
"const",
"npmProcess",
"=",
"spawn",
".",
"sync",
"(",
"\"npm\"",
",",
"[",
"\"show\"",
",",
"\"--json\"",
",",
"packageName",
",",
"\"peerDependencies\"",
"]",
",",
"{",
"encoding",
":",
"\"ut... | Fetch `peerDependencies` of the given package by `npm show` command.
@param {string} packageName The package name to fetch peerDependencies.
@returns {Object} Gotten peerDependencies. Returns null if npm was not found. | [
"Fetch",
"peerDependencies",
"of",
"the",
"given",
"package",
"by",
"npm",
"show",
"command",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/util/npm-utils.js#L70-L87 | train | Fetch peerDependencies from the specified package | [
30522,
3853,
18584,
28084,
25547,
11837,
4181,
9243,
1006,
7427,
18442,
1007,
1063,
9530,
3367,
27937,
8737,
3217,
9623,
2015,
1027,
25645,
1012,
26351,
1006,
1000,
27937,
2213,
1000,
1010,
1031,
1000,
2265,
1000,
1010,
1000,
1011,
1011,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
TryGhost/Ghost | core/server/api/v0.1/users.js | doQuery | function doQuery(options) {
return models.User.findOne(options.data, _.omit(options, ['data']))
.then((model) => {
if (!model) {
return Promise.reject(new common.errors.NotFoundError({
message: common.i18n.t('errors.api.... | javascript | function doQuery(options) {
return models.User.findOne(options.data, _.omit(options, ['data']))
.then((model) => {
if (!model) {
return Promise.reject(new common.errors.NotFoundError({
message: common.i18n.t('errors.api.... | [
"function",
"doQuery",
"(",
"options",
")",
"{",
"return",
"models",
".",
"User",
".",
"findOne",
"(",
"options",
".",
"data",
",",
"_",
".",
"omit",
"(",
"options",
",",
"[",
"'data'",
"]",
")",
")",
".",
"then",
"(",
"(",
"model",
")",
"=>",
"{... | ### Model Query
Make the call to the Model layer
@param {Object} options
@returns {Object} options | [
"###",
"Model",
"Query",
"Make",
"the",
"call",
"to",
"the",
"Model",
"layer"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/api/v0.1/users.js#L82-L95 | train | Query for a user | [
30522,
3853,
2079,
4226,
2854,
1006,
30524,
1033,
1007,
1007,
1012,
2059,
1006,
1006,
2944,
1007,
1027,
1028,
1063,
2065,
1006,
999,
2944,
1007,
1063,
2709,
4872,
1012,
15454,
1006,
2047,
2691,
1012,
10697,
1012,
2025,
14876,
20824,
29165,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/LiveDevelopmentUtils.js | isServerHtmlFileExt | function isServerHtmlFileExt(filePath) {
if (!filePath) {
return false;
}
return (_serverHtmlFileExts.indexOf(LanguageManager.getLanguageForPath(filePath).getId()) !== -1);
} | javascript | function isServerHtmlFileExt(filePath) {
if (!filePath) {
return false;
}
return (_serverHtmlFileExts.indexOf(LanguageManager.getLanguageForPath(filePath).getId()) !== -1);
} | [
"function",
"isServerHtmlFileExt",
"(",
"filePath",
")",
"{",
"if",
"(",
"!",
"filePath",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"_serverHtmlFileExts",
".",
"indexOf",
"(",
"LanguageManager",
".",
"getLanguageForPath",
"(",
"filePath",
")",
".",... | Determine if file extension is a server html file extension.
@param {string} filePath could be a path, a file name or just a file extension
@return {boolean} Returns true if fileExt is in the list | [
"Determine",
"if",
"file",
"extension",
"is",
"a",
"server",
"html",
"file",
"extension",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevelopmentUtils.js#L58-L64 | train | Check if a file is a server html file extension | [
30522,
3853,
26354,
2121,
6299,
11039,
19968,
8873,
10559,
18413,
1006,
5371,
15069,
1007,
1063,
2065,
1006,
999,
5371,
15069,
1007,
1063,
2709,
6270,
1025,
1065,
2709,
1006,
1035,
8241,
11039,
19968,
8873,
10559,
18413,
2015,
1012,
5950,
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 | plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js | function() {
var i = 0,
length = arr.length,
newArray = [];
for (; i<length; i++) {
newArray.push(arr[i]);
}
return newArray;
} | javascript | function() {
var i = 0,
length = arr.length,
newArray = [];
for (; i<length; i++) {
newArray.push(arr[i]);
}
return newArray;
} | [
"function",
"(",
")",
"{",
"var",
"i",
"=",
"0",
",",
"length",
"=",
"arr",
".",
"length",
",",
"newArray",
"=",
"[",
"]",
";",
"for",
"(",
";",
"i",
"<",
"length",
";",
"i",
"++",
")",
"{",
"newArray",
".",
"push",
"(",
"arr",
"[",
"i",
"]... | Return a clean native array
Following will convert a Live NodeList to a proper Array
@example
var childNodes = wysihtml5.lang.array(document.body.childNodes).get(); | [
"Return",
"a",
"clean",
"native",
"array"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L4647-L4655 | train | returns an array of the array of the terms | [
30522,
3853,
1006,
1007,
1063,
13075,
1045,
1027,
1014,
1010,
3091,
1027,
12098,
2099,
1012,
3091,
1010,
2047,
2906,
9447,
1027,
1031,
1033,
1025,
2005,
1006,
1025,
1045,
1026,
3091,
1025,
1045,
1009,
1009,
1007,
1063,
2047,
2906,
9447,
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... | |
jiahaog/nativefier | app/src/helpers/inferFlash.js | findSync | function findSync(pattern, basePath, findDir) {
const matches = [];
(function findSyncRecurse(base) {
let children;
try {
children = fs.readdirSync(base);
} catch (exception) {
if (exception.code === 'ENOENT') {
return;
}
throw exception;
}
children.forEach((chi... | javascript | function findSync(pattern, basePath, findDir) {
const matches = [];
(function findSyncRecurse(base) {
let children;
try {
children = fs.readdirSync(base);
} catch (exception) {
if (exception.code === 'ENOENT') {
return;
}
throw exception;
}
children.forEach((chi... | [
"function",
"findSync",
"(",
"pattern",
",",
"basePath",
",",
"findDir",
")",
"{",
"const",
"matches",
"=",
"[",
"]",
";",
"(",
"function",
"findSyncRecurse",
"(",
"base",
")",
"{",
"let",
"children",
";",
"try",
"{",
"children",
"=",
"fs",
".",
"readd... | Synchronously find a file or directory
@param {RegExp} pattern regex
@param {string} base path
@param {boolean} [findDir] if true, search results will be limited to only directories
@returns {Array} | [
"Synchronously",
"find",
"a",
"file",
"or",
"directory"
] | b959956a38ce51a9dd95d42308f0a6c66489b624 | https://github.com/jiahaog/nativefier/blob/b959956a38ce51a9dd95d42308f0a6c66489b624/app/src/helpers/inferFlash.js#L14-L52 | train | Find all files in a directory that match the given pattern | [
30522,
3853,
4858,
6038,
2278,
1006,
5418,
1010,
2918,
15069,
1010,
2424,
4305,
2099,
1007,
1063,
9530,
3367,
3503,
1027,
1031,
1033,
1025,
1006,
3853,
4858,
6038,
16748,
10841,
22573,
1006,
2918,
1007,
1063,
2292,
2336,
1025,
3046,
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... |
catapult-project/catapult | third_party/polymer3/bower_components/polymer/lib/utils/gestures.js | _add | function _add(node, evType, handler) {
let recognizer = gestures[evType];
let deps = recognizer.deps;
let name = recognizer.name;
let gobj = node[GESTURE_KEY];
if (!gobj) {
node[GESTURE_KEY] = gobj = {};
}
for (let i = 0, dep, gd; i < deps.length; i++) {
dep = deps[i];
// don't add mouse handl... | javascript | function _add(node, evType, handler) {
let recognizer = gestures[evType];
let deps = recognizer.deps;
let name = recognizer.name;
let gobj = node[GESTURE_KEY];
if (!gobj) {
node[GESTURE_KEY] = gobj = {};
}
for (let i = 0, dep, gd; i < deps.length; i++) {
dep = deps[i];
// don't add mouse handl... | [
"function",
"_add",
"(",
"node",
",",
"evType",
",",
"handler",
")",
"{",
"let",
"recognizer",
"=",
"gestures",
"[",
"evType",
"]",
";",
"let",
"deps",
"=",
"recognizer",
".",
"deps",
";",
"let",
"name",
"=",
"recognizer",
".",
"name",
";",
"let",
"g... | automate the event listeners for the native events
@private
@param {!HTMLElement} node Node on which to add the event.
@param {string} evType Event type to add.
@param {function(!Event)} handler Event handler function.
@return {void}
@this {Gestures} | [
"automate",
"the",
"event",
"listeners",
"for",
"the",
"native",
"events"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer3/bower_components/polymer/lib/utils/gestures.js#L539-L567 | train | Add event handler to a node | [
30522,
3853,
1035,
5587,
1006,
13045,
1010,
23408,
13874,
1010,
28213,
1007,
1063,
2292,
6807,
2099,
1027,
18327,
1031,
23408,
13874,
1033,
1025,
2292,
2139,
4523,
1027,
6807,
2099,
1012,
2139,
4523,
1025,
2292,
2171,
1027,
6807,
2099,
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... |
webdriverio/webdriverio | packages/wdio-sync/src/index.js | function (fn, repeatTest = 0, args = []) {
let result, error
/**
* if a new hook gets executed we can assume that all commands should have finised
* with exception of timeouts where `commandIsRunning` will never be reset but here
*/
// commandIsRunning = false
try {
result = fn.... | javascript | function (fn, repeatTest = 0, args = []) {
let result, error
/**
* if a new hook gets executed we can assume that all commands should have finised
* with exception of timeouts where `commandIsRunning` will never be reset but here
*/
// commandIsRunning = false
try {
result = fn.... | [
"function",
"(",
"fn",
",",
"repeatTest",
"=",
"0",
",",
"args",
"=",
"[",
"]",
")",
"{",
"let",
"result",
",",
"error",
"/**\n * if a new hook gets executed we can assume that all commands should have finised\n * with exception of timeouts where `commandIsRunning` will n... | execute test or hook asynchronously
@param {Function} fn spec or hook method
@param {Number} repeatTest number of retries
@return {Promise} that gets resolved once test/hook is done or was retried enough | [
"execute",
"test",
"or",
"hook",
"asynchronously"
] | 8de7f1a3b12d97282ed4ee2e25e4c3c9a8940ac1 | https://github.com/webdriverio/webdriverio/blob/8de7f1a3b12d97282ed4ee2e25e4c3c9a8940ac1/packages/wdio-sync/src/index.js#L54-L98 | train | Execute a function in a new context | [
30522,
3853,
1006,
1042,
2078,
1010,
9377,
22199,
1027,
30524,
2064,
7868,
2008,
2035,
10954,
2323,
2031,
10346,
5084,
1008,
2007,
6453,
1997,
2051,
12166,
2073,
1036,
3094,
2483,
15532,
5582,
1036,
2097,
2196,
2022,
25141,
2021,
2182,
1008... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
grpc/grpc-node | packages/grpc-native-core/src/client.js | ClientDuplexStream | function ClientDuplexStream(call) {
Duplex.call(this, {objectMode: true});
this.call = call;
/* Status generated from reading messages from the server. Overrides the
* status from the server if not OK */
this.read_status = null;
/* Status received from the server. */
this.received_status = null;
var se... | javascript | function ClientDuplexStream(call) {
Duplex.call(this, {objectMode: true});
this.call = call;
/* Status generated from reading messages from the server. Overrides the
* status from the server if not OK */
this.read_status = null;
/* Status received from the server. */
this.received_status = null;
var se... | [
"function",
"ClientDuplexStream",
"(",
"call",
")",
"{",
"Duplex",
".",
"call",
"(",
"this",
",",
"{",
"objectMode",
":",
"true",
"}",
")",
";",
"this",
".",
"call",
"=",
"call",
";",
"/* Status generated from reading messages from the server. Overrides the\n * st... | A stream that the client can read from or write to. Used for calls with
duplex streaming.
@constructor grpc~ClientDuplexStream
@extends external:Duplex
@borrows grpc~ClientUnaryCall#cancel as grpc~ClientDuplexStream#cancel
@borrows grpc~ClientUnaryCall#getPeer as grpc~ClientDuplexStream#getPeer
@borrows grpc~ClientWrit... | [
"A",
"stream",
"that",
"the",
"client",
"can",
"read",
"from",
"or",
"write",
"to",
".",
"Used",
"for",
"calls",
"with",
"duplex",
"streaming",
"."
] | b36b285f4cdb334bbd48f74c12c13bec69961488 | https://github.com/grpc/grpc-node/blob/b36b285f4cdb334bbd48f74c12c13bec69961488/packages/grpc-native-core/src/client.js#L281-L293 | train | A stream that can be used to read messages from the server. | [
30522,
3853,
7396,
8566,
19386,
21422,
1006,
2655,
1007,
1063,
4241,
19386,
1012,
2655,
1006,
2023,
1010,
1063,
4874,
5302,
3207,
1024,
2995,
1065,
1007,
1025,
2023,
1012,
2655,
1027,
2655,
1025,
1013,
1008,
3570,
7013,
2013,
3752,
7696,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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(array, key, defaultValue)
{
var value = (array != null) ? array[key] : null;
if (value == null)
{
value = defaultValue;
}
return value;
} | javascript | function(array, key, defaultValue)
{
var value = (array != null) ? array[key] : null;
if (value == null)
{
value = defaultValue;
}
return value;
} | [
"function",
"(",
"array",
",",
"key",
",",
"defaultValue",
")",
"{",
"var",
"value",
"=",
"(",
"array",
"!=",
"null",
")",
"?",
"array",
"[",
"key",
"]",
":",
"null",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"value",
"=",
"defaultValue",
... | Function: getValue
Returns the value for the given key in the given associative array or
the given default value if the value is null.
Parameters:
array - Associative array that contains the value for the key.
key - Key whose value should be returned.
defaultValue - Value to be returned if the value for the given
ke... | [
"Function",
":",
"getValue"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L3774-L3784 | train | Get the value of a key in an array | [
30522,
3853,
1006,
9140,
1010,
3145,
1010,
12398,
10175,
5657,
1007,
1063,
13075,
3643,
1027,
1006,
9140,
999,
1027,
19701,
1007,
1029,
9140,
1031,
3145,
1033,
1024,
19701,
1025,
2065,
1006,
3643,
1027,
1027,
19701,
1007,
1063,
3643,
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/core/util/animation/animate.js | reverseTranslate | function reverseTranslate (newFrom) {
return $animateCss(target, {
to: newFrom || from,
addClass: options.transitionOutClass,
removeClass: options.transitionInClass,
duration: options.duration
}).start();
} | javascript | function reverseTranslate (newFrom) {
return $animateCss(target, {
to: newFrom || from,
addClass: options.transitionOutClass,
removeClass: options.transitionInClass,
duration: options.duration
}).start();
} | [
"function",
"reverseTranslate",
"(",
"newFrom",
")",
"{",
"return",
"$animateCss",
"(",
"target",
",",
"{",
"to",
":",
"newFrom",
"||",
"from",
",",
"addClass",
":",
"options",
".",
"transitionOutClass",
",",
"removeClass",
":",
"options",
".",
"transitionInCl... | Specific reversal of the request translate animation above... | [
"Specific",
"reversal",
"of",
"the",
"request",
"translate",
"animation",
"above",
"..."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/animation/animate.js#L40-L48 | train | reverseTranslate - reverse the translation | [
30522,
3853,
7901,
6494,
3619,
13806,
1006,
2047,
19699,
5358,
1007,
1063,
2709,
1002,
2019,
21499,
6169,
2015,
1006,
4539,
1010,
1063,
2000,
1024,
2047,
19699,
5358,
1064,
1064,
2013,
1010,
5587,
26266,
1024,
7047,
1012,
6653,
5833,
26266,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GitbookIO/gitbook | lib/output/website/createTemplateEngine.js | fileExists | function fileExists(fileName) {
if (!fileName) {
return false;
}
var filePath = PathUtils.resolveInRoot(outputFolder, fileName);
return fs.existsSync(filePath);
} | javascript | function fileExists(fileName) {
if (!fileName) {
return false;
}
var filePath = PathUtils.resolveInRoot(outputFolder, fileName);
return fs.existsSync(filePath);
} | [
"function",
"fileExists",
"(",
"fileName",
")",
"{",
"if",
"(",
"!",
"fileName",
")",
"{",
"return",
"false",
";",
"}",
"var",
"filePath",
"=",
"PathUtils",
".",
"resolveInRoot",
"(",
"outputFolder",
",",
"fileName",
")",
";",
"return",
"fs",
".",
"exist... | Check if a file exists
@param {String} fileName
@return {Boolean} | [
"Check",
"if",
"a",
"file",
"exists"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/output/website/createTemplateEngine.js#L61-L68 | train | Check if the file exists in the output folder | [
30522,
3853,
5371,
10288,
5130,
1006,
5371,
18442,
1007,
1063,
2065,
1006,
999,
5371,
18442,
1007,
1063,
2709,
6270,
1025,
1065,
13075,
5371,
15069,
1027,
4130,
21823,
4877,
1012,
10663,
2378,
3217,
4140,
1006,
6434,
10371,
2121,
1010,
5371... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
uber/deck.gl | modules/layers/src/solid-polygon-layer/polygon.js | isNestedRingClosed | function isNestedRingClosed(simplePolygon) {
// check if first and last vertex are the same
const p0 = simplePolygon[0];
const p1 = simplePolygon[simplePolygon.length - 1];
return p0[0] === p1[0] && p0[1] === p1[1] && p0[2] === p1[2];
} | javascript | function isNestedRingClosed(simplePolygon) {
// check if first and last vertex are the same
const p0 = simplePolygon[0];
const p1 = simplePolygon[simplePolygon.length - 1];
return p0[0] === p1[0] && p0[1] === p1[1] && p0[2] === p1[2];
} | [
"function",
"isNestedRingClosed",
"(",
"simplePolygon",
")",
"{",
"// check if first and last vertex are the same",
"const",
"p0",
"=",
"simplePolygon",
"[",
"0",
"]",
";",
"const",
"p1",
"=",
"simplePolygon",
"[",
"simplePolygon",
".",
"length",
"-",
"1",
"]",
";... | Check if a simple polygon is a closed ring
@param {Array} simplePolygon - array of points
@return {Boolean} - true if the simple polygon is a closed ring | [
"Check",
"if",
"a",
"simple",
"polygon",
"is",
"a",
"closed",
"ring"
] | a2010448b7f268bbd03617b812334c68a6b9e5b2 | https://github.com/uber/deck.gl/blob/a2010448b7f268bbd03617b812334c68a6b9e5b2/modules/layers/src/solid-polygon-layer/polygon.js#L57-L63 | train | Check if simple polygon is closed | [
30522,
3853,
3475,
17944,
4892,
20464,
24768,
1006,
3722,
18155,
2100,
7446,
1007,
1063,
1013,
1013,
4638,
2065,
2034,
1998,
2197,
19449,
2024,
1996,
2168,
9530,
3367,
1052,
2692,
1027,
3722,
18155,
2100,
7446,
1031,
1014,
1033,
1025,
9530,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/RemoteFileAdapter/main.js | _setMenuItemsVisible | function _setMenuItemsVisible() {
var file = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE),
cMenuItems = [Commands.FILE_SAVE, Commands.FILE_RENAME, Commands.NAVIGATE_SHOW_IN_FILE_TREE, Commands.NAVIGATE_SHOW_IN_OS],
// Enable menu options when no file is present in ... | javascript | function _setMenuItemsVisible() {
var file = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE),
cMenuItems = [Commands.FILE_SAVE, Commands.FILE_RENAME, Commands.NAVIGATE_SHOW_IN_FILE_TREE, Commands.NAVIGATE_SHOW_IN_OS],
// Enable menu options when no file is present in ... | [
"function",
"_setMenuItemsVisible",
"(",
")",
"{",
"var",
"file",
"=",
"MainViewManager",
".",
"getCurrentlyViewedFile",
"(",
"MainViewManager",
".",
"ACTIVE_PANE",
")",
",",
"cMenuItems",
"=",
"[",
"Commands",
".",
"FILE_SAVE",
",",
"Commands",
".",
"FILE_RENAME"... | Disable context menus which are not useful for remote file | [
"Disable",
"context",
"menus",
"which",
"are",
"not",
"useful",
"for",
"remote",
"file"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RemoteFileAdapter/main.js#L59-L69 | train | Set menu items visible | [
30522,
3853,
1035,
2275,
3549,
14663,
6633,
2015,
11365,
7028,
1006,
1007,
1063,
13075,
5371,
1027,
2364,
8584,
24805,
4590,
1012,
2131,
10841,
14343,
20630,
8584,
2098,
8873,
2571,
1006,
2364,
8584,
24805,
4590,
1012,
3161,
1035,
6090,
206... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
tensorflow/tfjs-models | posenet/demos/coco.js | decodeSinglePoseAndDrawResults | async function decodeSinglePoseAndDrawResults() {
if (!modelOutputs) {
return;
}
const pose = await posenet.decodeSinglePose(
modelOutputs.heatmapScores, modelOutputs.offsets, guiState.outputStride);
drawSinglePoseResults(pose);
} | javascript | async function decodeSinglePoseAndDrawResults() {
if (!modelOutputs) {
return;
}
const pose = await posenet.decodeSinglePose(
modelOutputs.heatmapScores, modelOutputs.offsets, guiState.outputStride);
drawSinglePoseResults(pose);
} | [
"async",
"function",
"decodeSinglePoseAndDrawResults",
"(",
")",
"{",
"if",
"(",
"!",
"modelOutputs",
")",
"{",
"return",
";",
"}",
"const",
"pose",
"=",
"await",
"posenet",
".",
"decodeSinglePose",
"(",
"modelOutputs",
".",
"heatmapScores",
",",
"modelOutputs",... | Converts the raw model output results into single-pose estimation results | [
"Converts",
"the",
"raw",
"model",
"output",
"results",
"into",
"single",
"-",
"pose",
"estimation",
"results"
] | af194797c90cc5bcac1060d3cd41b0258a34c7dc | https://github.com/tensorflow/tfjs-models/blob/af194797c90cc5bcac1060d3cd41b0258a34c7dc/posenet/demos/coco.js#L282-L291 | train | Decode single pose and draw results | [
30522,
2004,
6038,
2278,
3853,
21933,
6155,
2075,
2571,
20688,
5685,
7265,
13088,
2229,
11314,
2015,
1006,
1007,
1063,
2065,
1006,
999,
2944,
5833,
18780,
2015,
1007,
1063,
2709,
1025,
1065,
9530,
3367,
13382,
1027,
26751,
13382,
7159,
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... |
SheetJS/js-xlsx | bits/78_writebiff.js | write_biff2_buf | function write_biff2_buf(wb/*:Workbook*/, opts/*:WriteOpts*/) {
var o = opts || {};
if(DENSE != null && o.dense == null) o.dense = DENSE;
var ba = buf_array();
var idx = 0;
for(var i=0;i<wb.SheetNames.length;++i) if(wb.SheetNames[i] == o.sheet) idx=i;
if(idx == 0 && !!o.sheet && wb.SheetNames[0] != o.sheet) throw... | javascript | function write_biff2_buf(wb/*:Workbook*/, opts/*:WriteOpts*/) {
var o = opts || {};
if(DENSE != null && o.dense == null) o.dense = DENSE;
var ba = buf_array();
var idx = 0;
for(var i=0;i<wb.SheetNames.length;++i) if(wb.SheetNames[i] == o.sheet) idx=i;
if(idx == 0 && !!o.sheet && wb.SheetNames[0] != o.sheet) throw... | [
"function",
"write_biff2_buf",
"(",
"wb",
"/*:Workbook*/",
",",
"opts",
"/*:WriteOpts*/",
")",
"{",
"var",
"o",
"=",
"opts",
"||",
"{",
"}",
";",
"if",
"(",
"DENSE",
"!=",
"null",
"&&",
"o",
".",
"dense",
"==",
"null",
")",
"o",
".",
"dense",
"=",
... | /* Based on test files | [
"/",
"*",
"Based",
"on",
"test",
"files"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/bits/78_writebiff.js#L78-L91 | train | Writes a BIFF2 record to a workbook | [
30522,
3853,
4339,
1035,
12170,
4246,
2475,
1035,
20934,
2546,
1006,
25610,
1013,
1008,
1024,
2147,
8654,
1008,
1013,
1010,
23569,
2015,
1013,
1008,
1024,
4339,
7361,
3215,
1008,
1013,
1007,
1063,
13075,
1051,
1027,
23569,
2015,
1064,
1064,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js | annotationAtParameter | function annotationAtParameter(sSegment, sWholeSegment) {
var mAnnotationsXAllOverloads,
sIndividualOverloadTarget,
aOverloads,
sSignature = "",
sTerm = sWholeSegment.slice(sSegment.length);
if (sTerm && maybeParameter(sSegment, vResult)) {
// not looking for parameter itself, but for ... | javascript | function annotationAtParameter(sSegment, sWholeSegment) {
var mAnnotationsXAllOverloads,
sIndividualOverloadTarget,
aOverloads,
sSignature = "",
sTerm = sWholeSegment.slice(sSegment.length);
if (sTerm && maybeParameter(sSegment, vResult)) {
// not looking for parameter itself, but for ... | [
"function",
"annotationAtParameter",
"(",
"sSegment",
",",
"sWholeSegment",
")",
"{",
"var",
"mAnnotationsXAllOverloads",
",",
"sIndividualOverloadTarget",
",",
"aOverloads",
",",
"sSignature",
"=",
"\"\"",
",",
"sTerm",
"=",
"sWholeSegment",
".",
"slice",
"(",
"sSe... | current object /*
Handles annotation at action/function parameter, taking care of individual versus all
overloads.
@param {string} sSegment
The current <code>sSegment</code> of <code>step</code>
@param {string} sWholeSegment
The current <code>aSegments[i]</code> of <code>step</code>
@returns {boolean}
<code>undefined<... | [
"current",
"object",
"/",
"*",
"Handles",
"annotation",
"at",
"action",
"/",
"function",
"parameter",
"taking",
"care",
"of",
"individual",
"versus",
"all",
"overloads",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/ODataMetaModel.js#L977-L1023 | train | This function is called when a parameter is found in the scope. | [
30522,
3853,
5754,
17287,
3508,
4017,
28689,
22828,
1006,
7020,
13910,
3672,
1010,
25430,
19990,
13910,
3672,
1007,
1063,
13075,
10856,
17287,
9285,
18684,
7174,
6299,
11066,
2015,
1010,
8254,
4305,
17258,
8787,
7840,
11066,
7559,
18150,
1010... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/RequestRecorder.js | resolveURL | function resolveURL(url) {
return new URI(url).absoluteTo(new URI(document.baseURI).search("")).toString();
} | javascript | function resolveURL(url) {
return new URI(url).absoluteTo(new URI(document.baseURI).search("")).toString();
} | [
"function",
"resolveURL",
"(",
"url",
")",
"{",
"return",
"new",
"URI",
"(",
"url",
")",
".",
"absoluteTo",
"(",
"new",
"URI",
"(",
"document",
".",
"baseURI",
")",
".",
"search",
"(",
"\"\"",
")",
")",
".",
"toString",
"(",
")",
";",
"}"
] | resolves the given (potentially relative) URL in the same way as the browser would resolve it | [
"resolves",
"the",
"given",
"(",
"potentially",
"relative",
")",
"URL",
"in",
"the",
"same",
"way",
"as",
"the",
"browser",
"would",
"resolve",
"it"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/RequestRecorder.js#L21-L23 | train | Resolve a URL to a base URI | [
30522,
3853,
10663,
3126,
2140,
1006,
24471,
2140,
1007,
1063,
2709,
2047,
24471,
2072,
1006,
24471,
2140,
1007,
1012,
7619,
3406,
1006,
2047,
24471,
2072,
1006,
6254,
1012,
2918,
9496,
1007,
1012,
3945,
1006,
1000,
1000,
1007,
1007,
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... |
TryGhost/Ghost | core/server/update-check.js | createCustomNotification | function createCustomNotification(notification) {
if (!notification) {
return Promise.resolve();
}
return Promise.each(notification.messages, function (message) {
let toAdd = {
// @NOTE: the update check service returns "0" or "1" (https://github.com/TryGhost/UpdateCheck/issues/... | javascript | function createCustomNotification(notification) {
if (!notification) {
return Promise.resolve();
}
return Promise.each(notification.messages, function (message) {
let toAdd = {
// @NOTE: the update check service returns "0" or "1" (https://github.com/TryGhost/UpdateCheck/issues/... | [
"function",
"createCustomNotification",
"(",
"notification",
")",
"{",
"if",
"(",
"!",
"notification",
")",
"{",
"return",
"Promise",
".",
"resolve",
"(",
")",
";",
"}",
"return",
"Promise",
".",
"each",
"(",
"notification",
".",
"messages",
",",
"function",... | @description Create a Ghost notification and call the API controller.
@param {Object} notification
@return {Promise} | [
"@description",
"Create",
"a",
"Ghost",
"notification",
"and",
"call",
"the",
"API",
"controller",
"."
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/update-check.js#L62-L83 | train | Create Custom Notification | [
30522,
3853,
3443,
7874,
20389,
17048,
9031,
1006,
26828,
1007,
1063,
2065,
1006,
999,
26828,
1007,
1063,
2709,
4872,
1012,
10663,
1006,
1007,
1025,
1065,
2709,
4872,
1012,
2169,
1006,
26828,
1012,
7696,
1010,
3853,
1006,
4471,
1007,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
firebase/firebase-js-sdk | packages/auth/demo/public/script.js | onReauthConfirmPhoneVerification | function onReauthConfirmPhoneVerification() {
var verificationId = $('#link-reauth-phone-verification-id').val();
var verificationCode = $('#link-reauth-phone-verification-code').val();
var credential = firebase.auth.PhoneAuthProvider.credential(
verificationId, verificationCode);
activeUser().reauthentic... | javascript | function onReauthConfirmPhoneVerification() {
var verificationId = $('#link-reauth-phone-verification-id').val();
var verificationCode = $('#link-reauth-phone-verification-code').val();
var credential = firebase.auth.PhoneAuthProvider.credential(
verificationId, verificationCode);
activeUser().reauthentic... | [
"function",
"onReauthConfirmPhoneVerification",
"(",
")",
"{",
"var",
"verificationId",
"=",
"$",
"(",
"'#link-reauth-phone-verification-id'",
")",
".",
"val",
"(",
")",
";",
"var",
"verificationCode",
"=",
"$",
"(",
"'#link-reauth-phone-verification-code'",
")",
".",... | Confirms a phone number verification for reauthentication. | [
"Confirms",
"a",
"phone",
"number",
"verification",
"for",
"reauthentication",
"."
] | 491598a499813dacc23724de5e237ec220cc560e | https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/auth/demo/public/script.js#L523-L534 | train | Confirm user s phone verification | [
30522,
3853,
2006,
16416,
14317,
8663,
27972,
9864,
6299,
9031,
1006,
1007,
1063,
13075,
22616,
3593,
1027,
1002,
1006,
1005,
1001,
4957,
1011,
2128,
4887,
2705,
1011,
3042,
1011,
22616,
1011,
8909,
1005,
1007,
1012,
11748,
1006,
1007,
1025... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/view/MainViewManager.js | _forEachPaneOrPanes | function _forEachPaneOrPanes(paneId, callback) {
if (paneId === ALL_PANES) {
_.forEach(_panes, callback);
} else {
callback(_getPane(paneId));
}
} | javascript | function _forEachPaneOrPanes(paneId, callback) {
if (paneId === ALL_PANES) {
_.forEach(_panes, callback);
} else {
callback(_getPane(paneId));
}
} | [
"function",
"_forEachPaneOrPanes",
"(",
"paneId",
",",
"callback",
")",
"{",
"if",
"(",
"paneId",
"===",
"ALL_PANES",
")",
"{",
"_",
".",
"forEach",
"(",
"_panes",
",",
"callback",
")",
";",
"}",
"else",
"{",
"callback",
"(",
"_getPane",
"(",
"paneId",
... | Iterates over the pane or ALL_PANES and calls the callback function for each.
@param {!string} paneId - id of the pane in which to adjust the scroll state, ALL_PANES or ACTIVE_PANE
@param {!function(!pane:Pane):boolean} callback - function to callback on to perform work.
The callback will receive a Pane and should retu... | [
"Iterates",
"over",
"the",
"pane",
"or",
"ALL_PANES",
"and",
"calls",
"the",
"callback",
"function",
"for",
"each",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L486-L492 | train | For each pane or panes | [
30522,
3853,
1035,
18921,
6776,
9739,
8780,
14536,
7231,
2015,
1006,
6090,
7416,
2094,
1010,
2655,
5963,
1007,
1063,
2065,
1006,
6090,
7416,
2094,
1027,
1027,
1027,
2035,
1035,
6090,
2229,
1007,
1063,
1035,
1012,
18921,
6776,
1006,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/document/DocumentManager.js | removeListFromWorkingSet | function removeListFromWorkingSet(list) {
DeprecationWarning.deprecationWarning("Use CommandManager.execute(Commands.FILE_CLOSE_LIST, {PaneId: MainViewManager.ALL_PANES, fileList: list}) instead of DocumentManager.removeListFromWorkingSet()", true);
CommandManager.execute(Commands.FILE_CLOSE_LIST, {Pane... | javascript | function removeListFromWorkingSet(list) {
DeprecationWarning.deprecationWarning("Use CommandManager.execute(Commands.FILE_CLOSE_LIST, {PaneId: MainViewManager.ALL_PANES, fileList: list}) instead of DocumentManager.removeListFromWorkingSet()", true);
CommandManager.execute(Commands.FILE_CLOSE_LIST, {Pane... | [
"function",
"removeListFromWorkingSet",
"(",
"list",
")",
"{",
"DeprecationWarning",
".",
"deprecationWarning",
"(",
"\"Use CommandManager.execute(Commands.FILE_CLOSE_LIST, {PaneId: MainViewManager.ALL_PANES, fileList: list}) instead of DocumentManager.removeListFromWorkingSet()\"",
",",
"tr... | closes a list of files
@deprecated Use CommandManager.execute(Commands.FILE_CLOSE_LIST) instead
@param {!Array.<File>} list - list of File objectgs to close | [
"closes",
"a",
"list",
"of",
"files"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentManager.js#L228-L231 | train | Removes a list of files from the working set | [
30522,
3853,
6366,
9863,
19699,
5358,
21398,
13462,
1006,
2862,
1007,
1063,
2139,
28139,
10719,
9028,
5582,
1012,
2139,
28139,
10719,
9028,
5582,
1006,
1000,
2224,
3094,
24805,
4590,
1012,
15389,
1006,
10954,
1012,
5371,
1035,
2485,
1035,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/linter.js | markVariableAsUsed | function markVariableAsUsed(scopeManager, currentNode, parserOptions, name) {
const hasGlobalReturn = parserOptions.ecmaFeatures && parserOptions.ecmaFeatures.globalReturn;
const specialScope = hasGlobalReturn || parserOptions.sourceType === "module";
const currentScope = getScope(scopeManager, currentNode)... | javascript | function markVariableAsUsed(scopeManager, currentNode, parserOptions, name) {
const hasGlobalReturn = parserOptions.ecmaFeatures && parserOptions.ecmaFeatures.globalReturn;
const specialScope = hasGlobalReturn || parserOptions.sourceType === "module";
const currentScope = getScope(scopeManager, currentNode)... | [
"function",
"markVariableAsUsed",
"(",
"scopeManager",
",",
"currentNode",
",",
"parserOptions",
",",
"name",
")",
"{",
"const",
"hasGlobalReturn",
"=",
"parserOptions",
".",
"ecmaFeatures",
"&&",
"parserOptions",
".",
"ecmaFeatures",
".",
"globalReturn",
";",
"cons... | Marks a variable as used in the current scope
@param {ScopeManager} scopeManager The scope manager for this AST. The scope may be mutated by this function.
@param {ASTNode} currentNode The node currently being traversed
@param {Object} parserOptions The options used to parse this text
@param {string} name The name of t... | [
"Marks",
"a",
"variable",
"as",
"used",
"in",
"the",
"current",
"scope"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/linter.js#L573-L591 | train | Mark a variable as used | [
30522,
3853,
2928,
10755,
19210,
3022,
13901,
1006,
9531,
24805,
4590,
1010,
2783,
3630,
3207,
1010,
11968,
8043,
7361,
9285,
1010,
2171,
1007,
1063,
9530,
3367,
2038,
23296,
16429,
2389,
13465,
14287,
1027,
11968,
8043,
7361,
9285,
1012,
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... |
necolas/react-native-web | packages/react-native-web/src/vendor/react-native/PanResponder/index.js | function (config) {
const interactionState = {
handle: (null: ?number),
};
const gestureState = {
// Useful for debugging
stateID: Math.random(),
};
PanResponder._initializeGestureState(gestureState);
const panHandlers = {
onStartShouldSetResponder: function (e) {
... | javascript | function (config) {
const interactionState = {
handle: (null: ?number),
};
const gestureState = {
// Useful for debugging
stateID: Math.random(),
};
PanResponder._initializeGestureState(gestureState);
const panHandlers = {
onStartShouldSetResponder: function (e) {
... | [
"function",
"(",
"config",
")",
"{",
"const",
"interactionState",
"=",
"{",
"handle",
":",
"(",
"null",
":",
"?",
"number",
")",
",",
"}",
";",
"const",
"gestureState",
"=",
"{",
"// Useful for debugging",
"stateID",
":",
"Math",
".",
"random",
"(",
")",... | @param {object} config Enhanced versions of all of the responder callbacks
that provide not only the typical `ResponderSyntheticEvent`, but also the
`PanResponder` gesture state. Simply replace the word `Responder` with
`PanResponder` in each of the typical `onResponder*` callbacks. For
example, the `config` object wo... | [
"@param",
"{",
"object",
"}",
"config",
"Enhanced",
"versions",
"of",
"all",
"of",
"the",
"responder",
"callbacks",
"that",
"provide",
"not",
"only",
"the",
"typical",
"ResponderSyntheticEvent",
"but",
"also",
"the",
"PanResponder",
"gesture",
"state",
".",
"Sim... | 801937748b2f3c96284bee1881164ac0c62a9c6d | https://github.com/necolas/react-native-web/blob/801937748b2f3c96284bee1881164ac0c62a9c6d/packages/react-native-web/src/vendor/react-native/PanResponder/index.js#L273-L391 | train | Creates a new state object for the pan responder system | [
30522,
3853,
1006,
9530,
8873,
2290,
1007,
1063,
9530,
3367,
10266,
12259,
1027,
1063,
5047,
1024,
1006,
19701,
1024,
1029,
2193,
1007,
1010,
1065,
1025,
9530,
3367,
18327,
12259,
1027,
1063,
1013,
1013,
6179,
2005,
2139,
8569,
12588,
2110,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.