repo stringclasses 192
values | path stringlengths 4 115 | func_name stringlengths 0 45 | original_string stringlengths 74 24k | language stringclasses 1
value | code stringlengths 74 24k | code_tokens listlengths 23 4.2k | docstring stringlengths 2 23.7k | docstring_tokens listlengths 1 810 | sha stringclasses 192
values | url stringlengths 90 200 | partition stringclasses 1
value | summary stringlengths 6 313 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
angular/material | src/core/util/util.js | disableBodyScroll | function disableBodyScroll() {
var documentElement = $document[0].documentElement;
var prevDocumentStyle = documentElement.style.cssText || '';
var prevBodyStyle = body.style.cssText || '';
var viewportTop = $mdUtil.getViewportTop();
$mdUtil.disableScrollAround._viewPortTop = v... | javascript | function disableBodyScroll() {
var documentElement = $document[0].documentElement;
var prevDocumentStyle = documentElement.style.cssText || '';
var prevBodyStyle = body.style.cssText || '';
var viewportTop = $mdUtil.getViewportTop();
$mdUtil.disableScrollAround._viewPortTop = v... | [
"function",
"disableBodyScroll",
"(",
")",
"{",
"var",
"documentElement",
"=",
"$document",
"[",
"0",
"]",
".",
"documentElement",
";",
"var",
"prevDocumentStyle",
"=",
"documentElement",
".",
"style",
".",
"cssText",
"||",
"''",
";",
"var",
"prevBodyStyle",
"... | Converts the body to a position fixed block and translate it to the proper scroll position | [
"Converts",
"the",
"body",
"to",
"a",
"position",
"fixed",
"block",
"and",
"translate",
"it",
"to",
"the",
"proper",
"scroll",
"position"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/util.js#L285-L321 | train | This function is called when the body is not visible. | [
30522,
3853,
4487,
19150,
23684,
11020,
28402,
30524,
2303,
1012,
2806,
1012,
20116,
13473,
18413,
1064,
1064,
1005,
1005,
1025,
13075,
3193,
6442,
14399,
1027,
1002,
9108,
21823,
2140,
1012,
2131,
8584,
6442,
14399,
1006,
1007,
1025,
1002,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/language/HTMLUtils.js | createTagInfo | function createTagInfo(tokenType, offset, tagName, attrName, attrValue, valueAssigned, quoteChar, hasEndQuote) {
return { tagName: tagName || "",
attr:
{ name: attrName || "",
value: attrValue || "",
valueAssigned: valueAssigned ||... | javascript | function createTagInfo(tokenType, offset, tagName, attrName, attrValue, valueAssigned, quoteChar, hasEndQuote) {
return { tagName: tagName || "",
attr:
{ name: attrName || "",
value: attrValue || "",
valueAssigned: valueAssigned ||... | [
"function",
"createTagInfo",
"(",
"tokenType",
",",
"offset",
",",
"tagName",
",",
"attrName",
",",
"attrValue",
",",
"valueAssigned",
",",
"quoteChar",
",",
"hasEndQuote",
")",
"{",
"return",
"{",
"tagName",
":",
"tagName",
"||",
"\"\"",
",",
"attr",
":",
... | Creates a tagInfo object and assures all the values are entered or are empty strings
@param {string=} tokenType what is getting edited and should be hinted
@param {number=} offset where the cursor is for the part getting hinted
@param {string=} tagName The name of the tag
@param {string=} attrName The name of the attri... | [
"Creates",
"a",
"tagInfo",
"object",
"and",
"assures",
"all",
"the",
"values",
"are",
"entered",
"or",
"are",
"empty",
"strings"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/HTMLUtils.js#L188-L199 | train | Creates a tag info object | [
30522,
3853,
3443,
15900,
2378,
14876,
1006,
19204,
13874,
1010,
16396,
1010,
6415,
18442,
1010,
2012,
16344,
18442,
1010,
2012,
16344,
10175,
5657,
1010,
3643,
12054,
23773,
2098,
1010,
14686,
7507,
2099,
1010,
2038,
10497,
28940,
12184,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/search/FindUtils.js | _doReplaceInDocument | function _doReplaceInDocument(doc, matchInfo, replaceText, isRegexp) {
// Double-check that the open document's timestamp matches the one we recorded. This
// should normally never go out of sync, because if it did we wouldn't start the
// replace in the first place (due to the fact that we imme... | javascript | function _doReplaceInDocument(doc, matchInfo, replaceText, isRegexp) {
// Double-check that the open document's timestamp matches the one we recorded. This
// should normally never go out of sync, because if it did we wouldn't start the
// replace in the first place (due to the fact that we imme... | [
"function",
"_doReplaceInDocument",
"(",
"doc",
",",
"matchInfo",
",",
"replaceText",
",",
"isRegexp",
")",
"{",
"// Double-check that the open document's timestamp matches the one we recorded. This",
"// should normally never go out of sync, because if it did we wouldn't start the",
"//... | Does a set of replacements in a single document in memory.
@param {!Document} doc The document to do the replacements in.
@param {Object} matchInfo The match info for this file, as returned by `_addSearchMatches()`. Might be mutated.
@param {string} replaceText The text to replace each result with.
@param {boolean=} is... | [
"Does",
"a",
"set",
"of",
"replacements",
"in",
"a",
"single",
"document",
"in",
"memory",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindUtils.js#L113-L135 | train | Replace the text in the search result set | [
30522,
3853,
1035,
2079,
2890,
24759,
10732,
22254,
10085,
27417,
2102,
1006,
9986,
1010,
2674,
2378,
14876,
1010,
5672,
18209,
1010,
2003,
2890,
3351,
2595,
2361,
1007,
1063,
1013,
1013,
3313,
1011,
4638,
2008,
1996,
2330,
6254,
1005,
1055... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/file-finder.js | normalizeDirectoryEntries | function normalizeDirectoryEntries(entries, directory, supportedConfigs) {
const fileHash = {};
entries.forEach(entry => {
if (supportedConfigs.indexOf(entry) >= 0) {
const resolvedEntry = path.resolve(directory, entry);
if (fs.statSync(resolvedEntry).isFile()) {
... | javascript | function normalizeDirectoryEntries(entries, directory, supportedConfigs) {
const fileHash = {};
entries.forEach(entry => {
if (supportedConfigs.indexOf(entry) >= 0) {
const resolvedEntry = path.resolve(directory, entry);
if (fs.statSync(resolvedEntry).isFile()) {
... | [
"function",
"normalizeDirectoryEntries",
"(",
"entries",
",",
"directory",
",",
"supportedConfigs",
")",
"{",
"const",
"fileHash",
"=",
"{",
"}",
";",
"entries",
".",
"forEach",
"(",
"entry",
"=>",
"{",
"if",
"(",
"supportedConfigs",
".",
"indexOf",
"(",
"en... | Create a hash of filenames from a directory listing
@param {string[]} entries Array of directory entries.
@param {string} directory Path to a current directory.
@param {string[]} supportedConfigs List of support filenames.
@returns {Object} Hashmap of filenames | [
"Create",
"a",
"hash",
"of",
"filenames",
"from",
"a",
"directory",
"listing"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/util/file-finder.js#L42-L55 | train | normalize directory entries | [
30522,
3853,
3671,
3550,
7442,
16761,
20684,
21011,
1006,
10445,
1010,
14176,
1010,
3569,
8663,
8873,
5620,
1007,
1063,
9530,
3367,
5371,
14949,
2232,
1027,
1063,
1065,
1025,
10445,
1012,
18921,
6776,
1006,
4443,
1027,
1028,
1063,
2065,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/utils/ViewUtils.js | function (map) {
var didSomething = false;
_.forEach(map, function (arr, key) {
// length > 1 means we have duplicates that need to be resolved
if (arr.length > 1) {
arr.forEach(function (index) {
if (filePaths[index].le... | javascript | function (map) {
var didSomething = false;
_.forEach(map, function (arr, key) {
// length > 1 means we have duplicates that need to be resolved
if (arr.length > 1) {
arr.forEach(function (index) {
if (filePaths[index].le... | [
"function",
"(",
"map",
")",
"{",
"var",
"didSomething",
"=",
"false",
";",
"_",
".",
"forEach",
"(",
"map",
",",
"function",
"(",
"arr",
",",
"key",
")",
"{",
"// length > 1 means we have duplicates that need to be resolved",
"if",
"(",
"arr",
".",
"length",
... | This function is used to loop through map and resolve duplicate names | [
"This",
"function",
"is",
"used",
"to",
"loop",
"through",
"map",
"and",
"resolve",
"duplicate",
"names"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ViewUtils.js#L440-L461 | train | return true if we have duplicates | [
30522,
3853,
1006,
4949,
1007,
1063,
13075,
2106,
14045,
20744,
1027,
6270,
1025,
1035,
1012,
18921,
6776,
1006,
4949,
1010,
3853,
1006,
12098,
2099,
1010,
3145,
1007,
1063,
1013,
1013,
3091,
1028,
1015,
2965,
2057,
2031,
24473,
2015,
2008,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/base/ManagedObjectMetadata.js | getScopeBasedDesignTime | function getScopeBasedDesignTime(mMetadata, sScopeKey) {
var mResult = mMetadata;
if ("default" in mMetadata) {
mResult = merge(
{},
mMetadata.default,
sScopeKey !== "default" && mMetadata[sScopeKey] || null
);
}
return mResult;
} | javascript | function getScopeBasedDesignTime(mMetadata, sScopeKey) {
var mResult = mMetadata;
if ("default" in mMetadata) {
mResult = merge(
{},
mMetadata.default,
sScopeKey !== "default" && mMetadata[sScopeKey] || null
);
}
return mResult;
} | [
"function",
"getScopeBasedDesignTime",
"(",
"mMetadata",
",",
"sScopeKey",
")",
"{",
"var",
"mResult",
"=",
"mMetadata",
";",
"if",
"(",
"\"default\"",
"in",
"mMetadata",
")",
"{",
"mResult",
"=",
"merge",
"(",
"{",
"}",
",",
"mMetadata",
".",
"default",
"... | Extracts metadata from metadata map by scope key
@param {object} mMetadata metadata map received from loader
@param {string} sScopeKey scope name to be extracted
@private | [
"Extracts",
"metadata",
"from",
"metadata",
"map",
"by",
"scope",
"key"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/ManagedObjectMetadata.js#L1873-L1885 | train | Returns a new object with the default design time as the scope key | [
30522,
3853,
4152,
16186,
15058,
14141,
2229,
23773,
7292,
1006,
3461,
12928,
2850,
2696,
1010,
7020,
16186,
14839,
1007,
1063,
13075,
2720,
2229,
11314,
1027,
3461,
12928,
2850,
2696,
1025,
2065,
1006,
1000,
12398,
1000,
1999,
3461,
12928,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | dist/js/demo.js | setup | function setup() {
var tmp = get('skin')
if (tmp && $.inArray(tmp, mySkins))
changeSkin(tmp)
// Add the change skin listener
$('[data-skin]').on('click', function (e) {
if ($(this).hasClass('knob'))
return
e.preventDefault()
... | javascript | function setup() {
var tmp = get('skin')
if (tmp && $.inArray(tmp, mySkins))
changeSkin(tmp)
// Add the change skin listener
$('[data-skin]').on('click', function (e) {
if ($(this).hasClass('knob'))
return
e.preventDefault()
... | [
"function",
"setup",
"(",
")",
"{",
"var",
"tmp",
"=",
"get",
"(",
"'skin'",
")",
"if",
"(",
"tmp",
"&&",
"$",
".",
"inArray",
"(",
"tmp",
",",
"mySkins",
")",
")",
"changeSkin",
"(",
"tmp",
")",
"// Add the change skin listener",
"$",
"(",
"'[data-ski... | Retrieve default settings and apply them to the template
@returns void | [
"Retrieve",
"default",
"settings",
"and",
"apply",
"them",
"to",
"the",
"template"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/dist/js/demo.js#L111-L167 | train | Setup the calendar | [
30522,
3853,
16437,
1006,
1007,
1063,
13075,
1056,
8737,
1027,
2131,
1006,
1005,
3096,
1005,
1007,
2065,
1006,
1056,
8737,
1004,
1004,
1002,
1012,
27118,
11335,
2100,
1006,
1056,
8737,
1010,
2026,
29334,
2015,
1007,
1007,
3431,
4939,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/LiveDevelopment/Agents/GotoAgent.js | _makeCSSTarget | function _makeCSSTarget(targets, rule) {
if (rule.sourceURL) {
var url = rule.sourceURL;
url += ":" + rule.style.range.start;
var name = rule.selectorList.text;
var file = _fileFromURL(url);
targets.push({"type": "css", "url": url, "name": name, "file"... | javascript | function _makeCSSTarget(targets, rule) {
if (rule.sourceURL) {
var url = rule.sourceURL;
url += ":" + rule.style.range.start;
var name = rule.selectorList.text;
var file = _fileFromURL(url);
targets.push({"type": "css", "url": url, "name": name, "file"... | [
"function",
"_makeCSSTarget",
"(",
"targets",
",",
"rule",
")",
"{",
"if",
"(",
"rule",
".",
"sourceURL",
")",
"{",
"var",
"url",
"=",
"rule",
".",
"sourceURL",
";",
"url",
"+=",
"\":\"",
"+",
"rule",
".",
"style",
".",
"range",
".",
"start",
";",
... | Make the given css rule a target for goto
@param [] targets array
@param {CSS.Rule} node | [
"Make",
"the",
"given",
"css",
"rule",
"a",
"target",
"for",
"goto"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/GotoAgent.js#L85-L93 | train | makeCSSTarget - make target for CSS rule | [
30522,
3853,
1035,
2191,
6169,
14117,
18150,
1006,
7889,
1010,
3627,
1007,
1063,
2065,
30524,
2140,
1009,
1027,
1000,
1024,
1000,
1009,
3627,
1012,
2806,
1012,
2846,
1012,
2707,
1025,
13075,
2171,
1027,
3627,
1012,
27000,
9863,
1012,
3793,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/date/Persian.js | d2g | function d2g(jdn) {
var j, i, gd, gm, gy;
j = 4 * jdn + 139361631;
j = j + div(div(4 * jdn + 183187720, 146097) * 3, 4) * 4 - 3908;
i = div(mod(j, 1461), 4) * 5 + 308;
gd = div(mod(i, 153), 5) + 1;
gm = mod(div(i, 153), 12) + 1;
gy = div(j, 1461) - 100100 + div(8 - gm, 6);
return {
year: gy,
month... | javascript | function d2g(jdn) {
var j, i, gd, gm, gy;
j = 4 * jdn + 139361631;
j = j + div(div(4 * jdn + 183187720, 146097) * 3, 4) * 4 - 3908;
i = div(mod(j, 1461), 4) * 5 + 308;
gd = div(mod(i, 153), 5) + 1;
gm = mod(div(i, 153), 12) + 1;
gy = div(j, 1461) - 100100 + div(8 - gm, 6);
return {
year: gy,
month... | [
"function",
"d2g",
"(",
"jdn",
")",
"{",
"var",
"j",
",",
"i",
",",
"gd",
",",
"gm",
",",
"gy",
";",
"j",
"=",
"4",
"*",
"jdn",
"+",
"139361631",
";",
"j",
"=",
"j",
"+",
"div",
"(",
"div",
"(",
"4",
"*",
"jdn",
"+",
"183187720",
",",
"14... | /*
Calculates Gregorian and Julian calendar dates from the Julian Day number
(jdn) for the period since jdn=-34839655 (i.e. the year -100100 of both
calendars) to some millions years ahead of the present.
@param jdn Julian Day number
@return
gy: Calendar year (years BC numbered 0, -1, -2, ...)
gm: Calendar month (1 to ... | [
"/",
"*",
"Calculates",
"Gregorian",
"and",
"Julian",
"calendar",
"dates",
"from",
"the",
"Julian",
"Day",
"number",
"(",
"jdn",
")",
"for",
"the",
"period",
"since",
"jdn",
"=",
"-",
"34839655",
"(",
"i",
".",
"e",
".",
"the",
"year",
"-",
"100100",
... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/date/Persian.js#L249-L262 | train | Convert jdn to g | [
30522,
3853,
1040,
2475,
2290,
1006,
26219,
2078,
1007,
1063,
13075,
1046,
1010,
1045,
1010,
1043,
2094,
1010,
13938,
1010,
1043,
2100,
1025,
1046,
1027,
1018,
1008,
26219,
2078,
1009,
16621,
21619,
16048,
21486,
1025,
1046,
1027,
1046,
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... |
tailwindcss/tailwindcss | src/cli/commands/build.js | buildToStdout | function buildToStdout(compileOptions) {
return compile(compileOptions).then(result => process.stdout.write(result.css))
} | javascript | function buildToStdout(compileOptions) {
return compile(compileOptions).then(result => process.stdout.write(result.css))
} | [
"function",
"buildToStdout",
"(",
"compileOptions",
")",
"{",
"return",
"compile",
"(",
"compileOptions",
")",
".",
"then",
"(",
"result",
"=>",
"process",
".",
"stdout",
".",
"write",
"(",
"result",
".",
"css",
")",
")",
"}"
] | Compiles CSS file and writes it to stdout.
@param {CompileOptions} compileOptions
@return {Promise} | [
"Compiles",
"CSS",
"file",
"and",
"writes",
"it",
"to",
"stdout",
"."
] | 5066a1e97b3f06b899a4539767ca2bee4bde2da9 | https://github.com/tailwindcss/tailwindcss/blob/5066a1e97b3f06b899a4539767ca2bee4bde2da9/src/cli/commands/build.js#L66-L68 | train | Builds the css file and writes it to stdout | [
30522,
3853,
3857,
13122,
2102,
26797,
2102,
1006,
4012,
22090,
7361,
9285,
1007,
1063,
2709,
4012,
22090,
1006,
4012,
22090,
7361,
9285,
1007,
1012,
2059,
1006,
2765,
1027,
1028,
2832,
1012,
2358,
26797,
2102,
1012,
4339,
1006,
2765,
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... |
cytoscape/cytoscape.js | dist/cytoscape.esm.js | getMap | function getMap(options) {
var obj = options.map;
var keys = options.keys;
var l = keys.length;
for (var i = 0; i < l; i++) {
var key = keys[i];
if (plainObject(key)) {
throw Error('Tried to get map with object key');
}
obj = obj[key];
if (obj == null) {
return obj;
}
}... | javascript | function getMap(options) {
var obj = options.map;
var keys = options.keys;
var l = keys.length;
for (var i = 0; i < l; i++) {
var key = keys[i];
if (plainObject(key)) {
throw Error('Tried to get map with object key');
}
obj = obj[key];
if (obj == null) {
return obj;
}
}... | [
"function",
"getMap",
"(",
"options",
")",
"{",
"var",
"obj",
"=",
"options",
".",
"map",
";",
"var",
"keys",
"=",
"options",
".",
"keys",
";",
"var",
"l",
"=",
"keys",
".",
"length",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"l",
... | gets the value in a map even if it's not built in places | [
"gets",
"the",
"value",
"in",
"a",
"map",
"even",
"if",
"it",
"s",
"not",
"built",
"in",
"places"
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L642-L662 | train | Get the map from the options | [
30522,
3853,
2131,
2863,
2361,
1006,
7047,
1007,
1063,
13075,
27885,
3501,
1027,
7047,
1012,
4949,
1025,
13075,
6309,
1027,
7047,
1012,
6309,
1025,
13075,
1048,
1027,
6309,
1012,
3091,
1025,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
badges/shields | services/nuget/nuget-v3-service-family.js | buildRoute | function buildRoute({ serviceBaseUrl, withTenant, withFeed }) {
let result
if (withTenant) {
result = new RouteBuilder().push(`(?:(.+)\\.)?${serviceBaseUrl}`, 'tenant')
} else {
result = new RouteBuilder({ base: serviceBaseUrl })
}
if (withFeed) {
result.push('([^/]+)', 'feed')
}
return result... | javascript | function buildRoute({ serviceBaseUrl, withTenant, withFeed }) {
let result
if (withTenant) {
result = new RouteBuilder().push(`(?:(.+)\\.)?${serviceBaseUrl}`, 'tenant')
} else {
result = new RouteBuilder({ base: serviceBaseUrl })
}
if (withFeed) {
result.push('([^/]+)', 'feed')
}
return result... | [
"function",
"buildRoute",
"(",
"{",
"serviceBaseUrl",
",",
"withTenant",
",",
"withFeed",
"}",
")",
"{",
"let",
"result",
"if",
"(",
"withTenant",
")",
"{",
"result",
"=",
"new",
"RouteBuilder",
"(",
")",
".",
"push",
"(",
"`",
"\\\\",
"${",
"serviceBase... | /*
Build the Shields service URL object for the given service configuration. Return
the RouteBuilder instance to which the service can add the route. | [
"/",
"*",
"Build",
"the",
"Shields",
"service",
"URL",
"object",
"for",
"the",
"given",
"service",
"configuration",
".",
"Return",
"the",
"RouteBuilder",
"instance",
"to",
"which",
"the",
"service",
"can",
"add",
"the",
"route",
"."
] | 283601423f3d1a19aae83bf62032d40683948636 | https://github.com/badges/shields/blob/283601423f3d1a19aae83bf62032d40683948636/services/nuget/nuget-v3-service-family.js#L14-L25 | train | Build a route from a service base url and optional parameters | [
30522,
3853,
3857,
22494,
2618,
1006,
1063,
2326,
15058,
3126,
2140,
1010,
2007,
6528,
4630,
1010,
2007,
7959,
2098,
1065,
1007,
1063,
2292,
2765,
2065,
1006,
2007,
6528,
4630,
1007,
1063,
2765,
1027,
2047,
2799,
8569,
23891,
2099,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/utils/StringMatch.js | _computeRangesAndScore | function _computeRangesAndScore(matchList, str, lastSegmentStart) {
var matchCounter;
var ranges = [];
var lastMatchIndex = -1;
var lastSegmentScore = 0;
var currentRangeStartedOnSpecial = false;
var score = 0;
var scoreDebug;
if (DEBUG_SCORES) {
... | javascript | function _computeRangesAndScore(matchList, str, lastSegmentStart) {
var matchCounter;
var ranges = [];
var lastMatchIndex = -1;
var lastSegmentScore = 0;
var currentRangeStartedOnSpecial = false;
var score = 0;
var scoreDebug;
if (DEBUG_SCORES) {
... | [
"function",
"_computeRangesAndScore",
"(",
"matchList",
",",
"str",
",",
"lastSegmentStart",
")",
"{",
"var",
"matchCounter",
";",
"var",
"ranges",
"=",
"[",
"]",
";",
"var",
"lastMatchIndex",
"=",
"-",
"1",
";",
"var",
"lastSegmentScore",
"=",
"0",
";",
"... | Converts a list of matches into a form suitable for returning from stringMatch.
@param {Array.<SpecialMatch|NormalMatch>} matchList to convert
@param {string} original string
@param {int} character index where last segment begins
@return {{ranges:Array.<{text:string, matched:boolean, includesLastSegment:boolean}>, mat... | [
"Converts",
"a",
"list",
"of",
"matches",
"into",
"a",
"form",
"suitable",
"for",
"returning",
"from",
"stringMatch",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/StringMatch.js#L507-L695 | train | Compute the ranges and score of the current range. | [
30522,
3853,
1035,
3274,
22043,
8791,
5104,
17345,
1006,
2674,
9863,
1010,
2358,
2099,
1010,
16180,
13910,
8163,
7559,
2102,
1007,
1063,
13075,
2674,
3597,
16671,
2121,
1025,
13075,
8483,
1027,
1031,
1033,
1025,
13075,
2197,
18900,
17231,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Cache.js | onSubmit | function onSubmit() {
oRequestLock = that.oRequestor.getModelInterface()
.lockGroup(sGroupId, true, that);
if (fnPatchSent) {
fnPatchSent();
}
} | javascript | function onSubmit() {
oRequestLock = that.oRequestor.getModelInterface()
.lockGroup(sGroupId, true, that);
if (fnPatchSent) {
fnPatchSent();
}
} | [
"function",
"onSubmit",
"(",
")",
"{",
"oRequestLock",
"=",
"that",
".",
"oRequestor",
".",
"getModelInterface",
"(",
")",
".",
"lockGroup",
"(",
"sGroupId",
",",
"true",
",",
"that",
")",
";",
"if",
"(",
"fnPatchSent",
")",
"{",
"fnPatchSent",
"(",
")",... | /*
Synchronous callback called when the request is put on the wire. Locks the group
so that further requests created via {@link ODataModel#submitBatch} wait until
this request has returned and its response is applied to the cache. | [
"/",
"*",
"Synchronous",
"callback",
"called",
"when",
"the",
"request",
"is",
"put",
"on",
"the",
"wire",
".",
"Locks",
"the",
"group",
"so",
"that",
"further",
"requests",
"created",
"via",
"{"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Cache.js#L875-L881 | train | Called when the form is submitted | [
30522,
3853,
2006,
6342,
25526,
4183,
1006,
1007,
1063,
10848,
15500,
7878,
1027,
2008,
1012,
10848,
15500,
2953,
1012,
2131,
5302,
9247,
18447,
2121,
12172,
1006,
1007,
1012,
5843,
17058,
1006,
22214,
22107,
3593,
1010,
2995,
1010,
2008,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-echarts | src/coord/parallel/Parallel.js | function (coord, dim) {
var axisLayout = this._axesLayout[dim];
return graphic.applyTransform([coord, 0], axisLayout.transform);
} | javascript | function (coord, dim) {
var axisLayout = this._axesLayout[dim];
return graphic.applyTransform([coord, 0], axisLayout.transform);
} | [
"function",
"(",
"coord",
",",
"dim",
")",
"{",
"var",
"axisLayout",
"=",
"this",
".",
"_axesLayout",
"[",
"dim",
"]",
";",
"return",
"graphic",
".",
"applyTransform",
"(",
"[",
"coord",
",",
"0",
"]",
",",
"axisLayout",
".",
"transform",
")",
";",
"... | Convert coords of each axis to Point.
Return point. For example: [10, 20]
@param {Array.<number>} coords
@param {string} dim
@return {Array.<number>} | [
"Convert",
"coords",
"of",
"each",
"axis",
"to",
"Point",
".",
"Return",
"point",
".",
"For",
"example",
":",
"[",
"10",
"20",
"]"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/coord/parallel/Parallel.js#L423-L426 | train | Returns the graphic for the given coord | [
30522,
3853,
1006,
2522,
8551,
1010,
11737,
1007,
1063,
13075,
8123,
8485,
5833,
1027,
2023,
1012,
1035,
19589,
8485,
5833,
1031,
11737,
1033,
1025,
2709,
8425,
1012,
6611,
6494,
3619,
14192,
1006,
1031,
2522,
8551,
1010,
1014,
1033,
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... | |
eslint/eslint | lib/rules/prefer-object-spread.js | defineFixer | function defineFixer(node, sourceCode) {
return function *(fixer) {
const leftParen = sourceCode.getTokenAfter(node.callee, isOpeningParenToken);
const rightParen = sourceCode.getLastToken(node);
// Remove the callee `Object.assign`
yield fixer.remove(node.callee);
// Repla... | javascript | function defineFixer(node, sourceCode) {
return function *(fixer) {
const leftParen = sourceCode.getTokenAfter(node.callee, isOpeningParenToken);
const rightParen = sourceCode.getLastToken(node);
// Remove the callee `Object.assign`
yield fixer.remove(node.callee);
// Repla... | [
"function",
"defineFixer",
"(",
"node",
",",
"sourceCode",
")",
"{",
"return",
"function",
"*",
"(",
"fixer",
")",
"{",
"const",
"leftParen",
"=",
"sourceCode",
".",
"getTokenAfter",
"(",
"node",
".",
"callee",
",",
"isOpeningParenToken",
")",
";",
"const",
... | Autofixes the Object.assign call to use an object spread instead.
@param {ASTNode|null} node - The node that the rule warns on, i.e. the Object.assign call
@param {string} sourceCode - sourceCode of the Object.assign call
@returns {Function} autofixer - replaces the Object.assign with a spread object. | [
"Autofixes",
"the",
"Object",
".",
"assign",
"call",
"to",
"use",
"an",
"object",
"spread",
"instead",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/prefer-object-spread.js#L149-L211 | train | Defines a fixer function for a given CallExpression. | [
30522,
3853,
9375,
8873,
2595,
2121,
1006,
13045,
1010,
3120,
16044,
1007,
1063,
2709,
3853,
1008,
1006,
8081,
2121,
1007,
1063,
9530,
3367,
2187,
19362,
2368,
1027,
3120,
16044,
1012,
2131,
18715,
8189,
6199,
2121,
1006,
13045,
1012,
2655,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
muaz-khan/RTCMultiConnection | dev/MediaStreamRecorder.js | StereoAudioRecorderHelper | function StereoAudioRecorderHelper(mediaStream, root) {
// variables
var deviceSampleRate = 44100; // range: 22050 to 96000
if (!ObjectStore.AudioContextConstructor) {
ObjectStore.AudioContextConstructor = new ObjectStore.AudioContext();
}
// check device sample rate
deviceSampleR... | javascript | function StereoAudioRecorderHelper(mediaStream, root) {
// variables
var deviceSampleRate = 44100; // range: 22050 to 96000
if (!ObjectStore.AudioContextConstructor) {
ObjectStore.AudioContextConstructor = new ObjectStore.AudioContext();
}
// check device sample rate
deviceSampleR... | [
"function",
"StereoAudioRecorderHelper",
"(",
"mediaStream",
",",
"root",
")",
"{",
"// variables ",
"var",
"deviceSampleRate",
"=",
"44100",
";",
"// range: 22050 to 96000",
"if",
"(",
"!",
"ObjectStore",
".",
"AudioContextConstructor",
")",
"{",
"ObjectStore",
".... | ============================ StereoAudioRecorderHelper.js source code from: http://typedarray.org/wp-content/projects/WebAudioRecorder/script.js | [
"============================",
"StereoAudioRecorderHelper",
".",
"js",
"source",
"code",
"from",
":",
"http",
":",
"//",
"typedarray",
".",
"org",
"/",
"wp",
"-",
"content",
"/",
"projects",
"/",
"WebAudioRecorder",
"/",
"script",
".",
"js"
] | 2032ce949bde30b43a3d2666e0f1e5afbf337f3d | https://github.com/muaz-khan/RTCMultiConnection/blob/2032ce949bde30b43a3d2666e0f1e5afbf337f3d/dev/MediaStreamRecorder.js#L1431-L1686 | train | Stereo Audio recorder helper | [
30522,
3853,
12991,
19513,
25346,
8586,
8551,
2121,
16001,
4842,
1006,
2865,
21422,
1010,
7117,
1007,
1063,
1013,
1013,
10857,
13075,
5733,
16613,
3917,
3686,
1027,
28015,
8889,
1025,
1013,
1013,
2846,
1024,
10545,
12376,
2000,
26637,
8889,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/command/Menus.js | removeMenu | function removeMenu(id) {
var menu,
commandID = "";
if (!id) {
console.error("removeMenu(): missing required parameter: id");
return;
}
if (!menuMap[id]) {
console.error("removeMenu(): menu id not found: %s", id);
return;
... | javascript | function removeMenu(id) {
var menu,
commandID = "";
if (!id) {
console.error("removeMenu(): missing required parameter: id");
return;
}
if (!menuMap[id]) {
console.error("removeMenu(): menu id not found: %s", id);
return;
... | [
"function",
"removeMenu",
"(",
"id",
")",
"{",
"var",
"menu",
",",
"commandID",
"=",
"\"\"",
";",
"if",
"(",
"!",
"id",
")",
"{",
"console",
".",
"error",
"(",
"\"removeMenu(): missing required parameter: id\"",
")",
";",
"return",
";",
"}",
"if",
"(",
"... | Removes a top-level menu from the application menu bar which may be native or HTML-based.
@param {!string} id - unique identifier for a menu.
Core Menus in Brackets use a simple title as an id, for example "file-menu".
Extensions should use the following format: "author.myextension.mymenuname". | [
"Removes",
"a",
"top",
"-",
"level",
"menu",
"from",
"the",
"application",
"menu",
"bar",
"which",
"may",
"be",
"native",
"or",
"HTML",
"-",
"based",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/Menus.js#L1113-L1152 | train | Remove a menu from the menu map | [
30522,
3853,
6366,
3549,
2226,
1006,
8909,
1007,
1063,
13075,
12183,
1010,
3094,
3593,
1027,
1000,
1000,
1025,
2065,
1006,
999,
8909,
1007,
1063,
10122,
1012,
7561,
1006,
1000,
6366,
3549,
2226,
1006,
1007,
1024,
4394,
3223,
16381,
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... |
dequelabs/axe-core | lib/commons/color/get-background-color.js | includeMissingElements | function includeMissingElements(elmStack, elm) {
/*eslint max-depth:["error",7]*/
const elementMap = {
TD: ['TR', 'TBODY'],
TH: ['TR', 'THEAD'],
INPUT: ['LABEL']
};
const tagArray = elmStack.map(elm => {
return elm.nodeName;
});
let bgNodes = elmStack;
for (let candidate in elementMap) {
// check that ... | javascript | function includeMissingElements(elmStack, elm) {
/*eslint max-depth:["error",7]*/
const elementMap = {
TD: ['TR', 'TBODY'],
TH: ['TR', 'THEAD'],
INPUT: ['LABEL']
};
const tagArray = elmStack.map(elm => {
return elm.nodeName;
});
let bgNodes = elmStack;
for (let candidate in elementMap) {
// check that ... | [
"function",
"includeMissingElements",
"(",
"elmStack",
",",
"elm",
")",
"{",
"/*eslint max-depth:[\"error\",7]*/",
"const",
"elementMap",
"=",
"{",
"TD",
":",
"[",
"'TR'",
",",
"'TBODY'",
"]",
",",
"TH",
":",
"[",
"'TR'",
",",
"'THEAD'",
"]",
",",
"INPUT",
... | Include nodes missing from initial gathering because
document.elementsFromPoint misses some elements we need
i.e. TR is missing from table elementStack and leaves out bgColor
https://github.com/dequelabs/axe-core/issues/273
@private
@param {Array} elmStack
@param {Element} elm
@returns {Array} | [
"Include",
"nodes",
"missing",
"from",
"initial",
"gathering",
"because",
"document",
".",
"elementsFromPoint",
"misses",
"some",
"elements",
"we",
"need",
"i",
".",
"e",
".",
"TR",
"is",
"missing",
"from",
"table",
"elementStack",
"and",
"leaves",
"out",
"bgC... | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/commons/color/get-background-color.js#L239-L284 | train | This function is used to include elements that are not in the elementStack. | [
30522,
3853,
2421,
15630,
7741,
12260,
8163,
1006,
17709,
9153,
3600,
1010,
17709,
1007,
1063,
1013,
1008,
9686,
4115,
2102,
4098,
1011,
5995,
1024,
1031,
1000,
7561,
1000,
1010,
1021,
1033,
1008,
1013,
9530,
3367,
5783,
2863,
2361,
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/Inspector/Inspector.js | _send | function _send(method, signature, varargs) {
if (!_socket) {
console.log("You must connect to the WebSocket before sending messages.");
// FUTURE: Our current implementation closes and re-opens an inspector connection whenever
// a new HTML file is selected. If done quickly ... | javascript | function _send(method, signature, varargs) {
if (!_socket) {
console.log("You must connect to the WebSocket before sending messages.");
// FUTURE: Our current implementation closes and re-opens an inspector connection whenever
// a new HTML file is selected. If done quickly ... | [
"function",
"_send",
"(",
"method",
",",
"signature",
",",
"varargs",
")",
"{",
"if",
"(",
"!",
"_socket",
")",
"{",
"console",
".",
"log",
"(",
"\"You must connect to the WebSocket before sending messages.\"",
")",
";",
"// FUTURE: Our current implementation closes and... | Send a message to the remote debugger
All passed arguments after the signature are passed on as parameters.
If the last argument is a function, it is used as the callback function.
@param {string} remote method
@param {object} the method signature | [
"Send",
"a",
"message",
"to",
"the",
"remote",
"debugger",
"All",
"passed",
"arguments",
"after",
"the",
"signature",
"are",
"passed",
"on",
"as",
"parameters",
".",
"If",
"the",
"last",
"argument",
"is",
"a",
"function",
"it",
"is",
"used",
"as",
"the",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Inspector/Inspector.js#L117-L166 | train | send a message to the remote server | [
30522,
3853,
1035,
4604,
1006,
4118,
1010,
30524,
5620,
1007,
1063,
2065,
1006,
999,
1035,
22278,
1007,
1063,
10122,
1012,
8833,
1006,
1000,
2017,
2442,
7532,
2000,
1996,
4773,
6499,
19869,
2102,
2077,
6016,
7696,
1012,
1000,
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/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js | function (msg) {
if (msg.params.url) {
// navigate to a new page.
window.location.replace(msg.params.url);
}
} | javascript | function (msg) {
if (msg.params.url) {
// navigate to a new page.
window.location.replace(msg.params.url);
}
} | [
"function",
"(",
"msg",
")",
"{",
"if",
"(",
"msg",
".",
"params",
".",
"url",
")",
"{",
"// navigate to a new page.",
"window",
".",
"location",
".",
"replace",
"(",
"msg",
".",
"params",
".",
"url",
")",
";",
"}",
"}"
] | Navigate to a different page.
@param {Object} msg | [
"Navigate",
"to",
"a",
"different",
"page",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js#L251-L256 | train | onmessage - > null | [
30522,
3853,
1006,
5796,
2290,
1007,
1063,
2065,
1006,
5796,
2290,
1012,
11498,
5244,
1012,
24471,
2140,
1007,
1063,
1013,
1013,
22149,
2000,
1037,
2047,
3931,
1012,
3332,
1012,
3295,
1012,
5672,
1006,
5796,
2290,
1012,
11498,
5244,
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... | |
moleculerjs/moleculer | src/serializers/proto/packets.proto.js | PacketDisconnect | function PacketDisconnect(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
} | javascript | function PacketDisconnect(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
} | [
"function",
"PacketDisconnect",
"(",
"properties",
")",
"{",
"if",
"(",
"properties",
")",
"for",
"(",
"var",
"keys",
"=",
"Object",
".",
"keys",
"(",
"properties",
")",
",",
"i",
"=",
"0",
";",
"i",
"<",
"keys",
".",
"length",
";",
"++",
"i",
")",... | Properties of a PacketDisconnect.
@memberof packets
@interface IPacketDisconnect
@property {string} ver PacketDisconnect ver
@property {string} sender PacketDisconnect sender
Constructs a new PacketDisconnect.
@memberof packets
@classdesc Represents a PacketDisconnect.
@implements IPacketDisconnect
@constructor
@para... | [
"Properties",
"of",
"a",
"PacketDisconnect",
"."
] | f95aadc2d61b0d0e3c643a43c3ed28bca6425cde | https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/serializers/proto/packets.proto.js#L1952-L1957 | train | Properties of a PacketDisconnect. | [
30522,
3853,
14771,
10521,
8663,
2638,
6593,
1006,
5144,
1007,
1063,
2065,
1006,
5144,
1007,
2005,
1006,
13075,
6309,
1027,
4874,
1012,
6309,
1006,
5144,
1007,
1010,
1045,
1027,
1014,
1025,
1045,
1026,
6309,
1012,
3091,
1025,
1009,
1009,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Dogfalo/materialize | dist/js/materialize.js | getWavesEffectElement | function getWavesEffectElement(e) {
if (TouchHandler.allowEvent(e) === false) {
return null;
}
var element = null;
var target = e.target || e.srcElement;
while (target.parentNode !== null) {
if (!(target instanceof SVGElement) && target.className.indexOf('waves-effect') !== -1) {
... | javascript | function getWavesEffectElement(e) {
if (TouchHandler.allowEvent(e) === false) {
return null;
}
var element = null;
var target = e.target || e.srcElement;
while (target.parentNode !== null) {
if (!(target instanceof SVGElement) && target.className.indexOf('waves-effect') !== -1) {
... | [
"function",
"getWavesEffectElement",
"(",
"e",
")",
"{",
"if",
"(",
"TouchHandler",
".",
"allowEvent",
"(",
"e",
")",
"===",
"false",
")",
"{",
"return",
"null",
";",
"}",
"var",
"element",
"=",
"null",
";",
"var",
"target",
"=",
"e",
".",
"target",
... | Delegated click handler for .waves-effect element.
returns null when .waves-effect element not in "click tree" | [
"Delegated",
"click",
"handler",
"for",
".",
"waves",
"-",
"effect",
"element",
".",
"returns",
"null",
"when",
".",
"waves",
"-",
"effect",
"element",
"not",
"in",
"click",
"tree"
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/dist/js/materialize.js#L5025-L5041 | train | Get the element that is the target of the waves - effect | [
30522,
3853,
2131,
16535,
20106,
25969,
12260,
3672,
1006,
1041,
1007,
1063,
2065,
1006,
3543,
11774,
3917,
1012,
3499,
18697,
3372,
1006,
1041,
1007,
1027,
1027,
1027,
6270,
1007,
1063,
2709,
19701,
1025,
1065,
13075,
5783,
1027,
19701,
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/search/node/FindInFilesDomain.js | getSearchMatches | function getSearchMatches(contents, queryExpr) {
if (!contents) {
return;
}
// Quick exit if not found or if we hit the limit
if (foundMaximum || contents.search(queryExpr) === -1) {
return [];
}
var match, lineNum, line, ch, totalMatchLength, matchedLines, numMatchedLines, last... | javascript | function getSearchMatches(contents, queryExpr) {
if (!contents) {
return;
}
// Quick exit if not found or if we hit the limit
if (foundMaximum || contents.search(queryExpr) === -1) {
return [];
}
var match, lineNum, line, ch, totalMatchLength, matchedLines, numMatchedLines, last... | [
"function",
"getSearchMatches",
"(",
"contents",
",",
"queryExpr",
")",
"{",
"if",
"(",
"!",
"contents",
")",
"{",
"return",
";",
"}",
"// Quick exit if not found or if we hit the limit",
"if",
"(",
"foundMaximum",
"||",
"contents",
".",
"search",
"(",
"queryExpr"... | Searches through the contents and returns an array of matches
@param {string} contents
@param {RegExp} queryExpr
@return {!Array.<{start: {line:number,ch:number}, end: {line:number,ch:number}, line: string}>} | [
"Searches",
"through",
"the",
"contents",
"and",
"returns",
"an",
"array",
"of",
"matches"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/node/FindInFilesDomain.js#L102-L180 | train | Search matches in the contents of a phrase | [
30522,
3853,
4152,
14644,
2818,
18900,
8376,
1006,
8417,
1010,
23032,
10288,
18098,
1007,
1063,
2065,
1006,
999,
8417,
1007,
1063,
2709,
1025,
1065,
1013,
1013,
4248,
6164,
2065,
2025,
2179,
2030,
2065,
2057,
2718,
1996,
5787,
2065,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
postcss/autoprefixer | lib/hacks/grid-utils.js | shouldInheritGap | function shouldInheritGap (selA, selB) {
let result
// get arrays of selector split in 3-deep array
let splitSelectorArrA = splitSelector(selA)
let splitSelectorArrB = splitSelector(selB)
if (splitSelectorArrA[0].length < splitSelectorArrB[0].length) {
// abort if selectorA has lower descendant specific... | javascript | function shouldInheritGap (selA, selB) {
let result
// get arrays of selector split in 3-deep array
let splitSelectorArrA = splitSelector(selA)
let splitSelectorArrB = splitSelector(selB)
if (splitSelectorArrA[0].length < splitSelectorArrB[0].length) {
// abort if selectorA has lower descendant specific... | [
"function",
"shouldInheritGap",
"(",
"selA",
",",
"selB",
")",
"{",
"let",
"result",
"// get arrays of selector split in 3-deep array",
"let",
"splitSelectorArrA",
"=",
"splitSelector",
"(",
"selA",
")",
"let",
"splitSelectorArrB",
"=",
"splitSelector",
"(",
"selB",
"... | Compare the selectors and decide if we
need to inherit gap from compared selector or not.
@type {String} selA
@type {String} selB
@return {Boolean} | [
"Compare",
"the",
"selectors",
"and",
"decide",
"if",
"we",
"need",
"to",
"inherit",
"gap",
"from",
"compared",
"selector",
"or",
"not",
"."
] | 24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32 | https://github.com/postcss/autoprefixer/blob/24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32/lib/hacks/grid-utils.js#L819-L863 | train | Returns true if selectorA is a descendant of selectorB | [
30522,
3853,
2323,
2378,
5886,
4183,
3654,
2361,
1006,
7367,
2721,
1010,
7367,
20850,
1007,
1063,
2292,
2765,
1013,
1013,
2131,
27448,
1997,
27000,
3975,
1999,
1017,
1011,
2784,
9140,
2292,
19584,
12260,
16761,
2906,
2527,
1027,
19584,
1226... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/CodeFolding/main.js | onActiveEditorChanged | function onActiveEditorChanged(event, current, previous) {
if (current && !current._codeMirror._lineFolds) {
enableFoldingInEditor(current);
}
if (previous) {
saveLineFolds(previous);
}
} | javascript | function onActiveEditorChanged(event, current, previous) {
if (current && !current._codeMirror._lineFolds) {
enableFoldingInEditor(current);
}
if (previous) {
saveLineFolds(previous);
}
} | [
"function",
"onActiveEditorChanged",
"(",
"event",
",",
"current",
",",
"previous",
")",
"{",
"if",
"(",
"current",
"&&",
"!",
"current",
".",
"_codeMirror",
".",
"_lineFolds",
")",
"{",
"enableFoldingInEditor",
"(",
"current",
")",
";",
"}",
"if",
"(",
"p... | When a brand new editor is seen, initialise fold-gutter and restore line folds in it.
Save line folds in departing editor in case it's getting closed.
@param {object} event the event object
@param {Editor} current the current editor
@param {Editor} previous the previous editor | [
"When",
"a",
"brand",
"new",
"editor",
"is",
"seen",
"initialise",
"fold",
"-",
"gutter",
"and",
"restore",
"line",
"folds",
"in",
"it",
".",
"Save",
"line",
"folds",
"in",
"departing",
"editor",
"in",
"case",
"it",
"s",
"getting",
"closed",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/main.js#L338-L345 | train | On active editor change | [
30522,
3853,
2006,
19620,
2098,
15660,
22305,
2098,
1006,
2724,
1010,
2783,
1010,
3025,
1007,
1063,
2065,
1006,
2783,
1004,
1004,
999,
2783,
1012,
1035,
3642,
14503,
29165,
1012,
1035,
2240,
10371,
2015,
1007,
1063,
9585,
21508,
21280,
1566... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | open | function open() {
// TODO: need to run _onDocumentChange() after load if doc != currentDocument here? Maybe not, since activeEditorChange
// doesn't trigger it, while inline editors can still cause edits in doc other than currentDoc...
_getInitialDocFromCurrent().done(function (doc) {
... | javascript | function open() {
// TODO: need to run _onDocumentChange() after load if doc != currentDocument here? Maybe not, since activeEditorChange
// doesn't trigger it, while inline editors can still cause edits in doc other than currentDoc...
_getInitialDocFromCurrent().done(function (doc) {
... | [
"function",
"open",
"(",
")",
"{",
"// TODO: need to run _onDocumentChange() after load if doc != currentDocument here? Maybe not, since activeEditorChange",
"// doesn't trigger it, while inline editors can still cause edits in doc other than currentDoc...",
"_getInitialDocFromCurrent",
"(",
")",
... | Open a live preview on the current docuemnt. | [
"Open",
"a",
"live",
"preview",
"on",
"the",
"current",
"docuemnt",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevMultiBrowser.js#L691-L717 | train | open the current document | [
30522,
3853,
2330,
1006,
1007,
1063,
1013,
1013,
28681,
2080,
1024,
2342,
2000,
2448,
1035,
2006,
3527,
24894,
4765,
22305,
2063,
1006,
1007,
2044,
7170,
2065,
9986,
999,
1027,
2783,
3527,
24894,
4765,
2182,
1029,
2672,
2025,
1010,
2144,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SheetJS/js-xlsx | xlsx.js | parse_MTRSettings | function parse_MTRSettings(blob) {
var fMTREnabled = blob.read_shift(4) !== 0x00;
var fUserSetThreadCount = blob.read_shift(4) !== 0x00;
var cUserThreadCount = blob.read_shift(4);
return [fMTREnabled, fUserSetThreadCount, cUserThreadCount];
} | javascript | function parse_MTRSettings(blob) {
var fMTREnabled = blob.read_shift(4) !== 0x00;
var fUserSetThreadCount = blob.read_shift(4) !== 0x00;
var cUserThreadCount = blob.read_shift(4);
return [fMTREnabled, fUserSetThreadCount, cUserThreadCount];
} | [
"function",
"parse_MTRSettings",
"(",
"blob",
")",
"{",
"var",
"fMTREnabled",
"=",
"blob",
".",
"read_shift",
"(",
"4",
")",
"!==",
"0x00",
";",
"var",
"fUserSetThreadCount",
"=",
"blob",
".",
"read_shift",
"(",
"4",
")",
"!==",
"0x00",
";",
"var",
"cUse... | /* [MS-XLS] 2.4.173 | [
"/",
"*",
"[",
"MS",
"-",
"XLS",
"]",
"2",
".",
"4",
".",
"173"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L6306-L6311 | train | Parse MTR settings | [
30522,
3853,
11968,
3366,
1035,
11047,
22573,
13027,
2015,
1006,
1038,
4135,
2497,
1007,
1063,
13075,
4718,
7913,
22966,
2094,
1027,
1038,
4135,
2497,
1012,
3191,
1035,
5670,
1006,
1018,
1007,
999,
1027,
1027,
1014,
2595,
8889,
1025,
13075,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Dogfalo/materialize | extras/noUiSlider/nouislider.js | offset | function offset ( elem, orientation ) {
var rect = elem.getBoundingClientRect(),
doc = elem.ownerDocument,
docElem = doc.documentElement,
pageOffset = getPageOffset();
// getBoundingClientRect contains left scroll in Chrome on Android.
// I haven't found a f... | javascript | function offset ( elem, orientation ) {
var rect = elem.getBoundingClientRect(),
doc = elem.ownerDocument,
docElem = doc.documentElement,
pageOffset = getPageOffset();
// getBoundingClientRect contains left scroll in Chrome on Android.
// I haven't found a f... | [
"function",
"offset",
"(",
"elem",
",",
"orientation",
")",
"{",
"var",
"rect",
"=",
"elem",
".",
"getBoundingClientRect",
"(",
")",
",",
"doc",
"=",
"elem",
".",
"ownerDocument",
",",
"docElem",
"=",
"doc",
".",
"documentElement",
",",
"pageOffset",
"=",
... | Current position of an element relative to the document. | [
"Current",
"position",
"of",
"an",
"element",
"relative",
"to",
"the",
"document",
"."
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/extras/noUiSlider/nouislider.js#L59-L74 | train | Get the offset of an element | [
30522,
3853,
16396,
1006,
3449,
6633,
1010,
10296,
1007,
1063,
13075,
28667,
2102,
1027,
3449,
6633,
1012,
2131,
15494,
2075,
20464,
11638,
2890,
6593,
1006,
1007,
1010,
9986,
1027,
3449,
6633,
1012,
3954,
3527,
24894,
4765,
1010,
9986,
122... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/computed-property-spacing.js | reportNoEndingSpace | function reportNoEndingSpace(node, token, tokenBefore) {
context.report({
node,
loc: token.loc.start,
messageId: "unexpectedSpaceBefore",
data: {
tokenValue: token.value
},
fix(fixer) {
... | javascript | function reportNoEndingSpace(node, token, tokenBefore) {
context.report({
node,
loc: token.loc.start,
messageId: "unexpectedSpaceBefore",
data: {
tokenValue: token.value
},
fix(fixer) {
... | [
"function",
"reportNoEndingSpace",
"(",
"node",
",",
"token",
",",
"tokenBefore",
")",
"{",
"context",
".",
"report",
"(",
"{",
"node",
",",
"loc",
":",
"token",
".",
"loc",
".",
"start",
",",
"messageId",
":",
"\"unexpectedSpaceBefore\"",
",",
"data",
":"... | Reports that there shouldn't be a space before the last token
@param {ASTNode} node - The node to report in the event of an error.
@param {Token} token - The token to use for the report.
@param {Token} tokenBefore - The token before `token`.
@returns {void} | [
"Reports",
"that",
"there",
"shouldn",
"t",
"be",
"a",
"space",
"before",
"the",
"last",
"token"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/computed-property-spacing.js#L77-L89 | train | Reports an unexpected space before the token. | [
30522,
3853,
3189,
3630,
18537,
23058,
1006,
13045,
1010,
19204,
1010,
19204,
4783,
29278,
2063,
1007,
1063,
6123,
1012,
3189,
1006,
1063,
13045,
1010,
8840,
2278,
1024,
19204,
1012,
8840,
2278,
1012,
2707,
1010,
4471,
3593,
1024,
1000,
922... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Batch.js | serializeHeaders | function serializeHeaders(mHeaders) {
var sHeaderName,
aHeaders = [];
for (sHeaderName in mHeaders) {
aHeaders = aHeaders.concat(sHeaderName, ":", mHeaders[sHeaderName], "\r\n");
}
return aHeaders;
} | javascript | function serializeHeaders(mHeaders) {
var sHeaderName,
aHeaders = [];
for (sHeaderName in mHeaders) {
aHeaders = aHeaders.concat(sHeaderName, ":", mHeaders[sHeaderName], "\r\n");
}
return aHeaders;
} | [
"function",
"serializeHeaders",
"(",
"mHeaders",
")",
"{",
"var",
"sHeaderName",
",",
"aHeaders",
"=",
"[",
"]",
";",
"for",
"(",
"sHeaderName",
"in",
"mHeaders",
")",
"{",
"aHeaders",
"=",
"aHeaders",
".",
"concat",
"(",
"sHeaderName",
",",
"\":\"",
",",
... | Serializes a map of request headers to be used in a $batch request.
@param {object} mHeaders
A map of request headers
@returns {object[]} Array representing the serialized headers | [
"Serializes",
"a",
"map",
"of",
"request",
"headers",
"to",
"be",
"used",
"in",
"a",
"$batch",
"request",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Batch.js#L218-L227 | train | Serialize headers to a string array | [
30522,
3853,
7642,
4697,
4974,
2545,
1006,
1049,
4974,
2545,
1007,
1063,
13075,
16994,
25888,
14074,
1010,
3805,
2545,
1027,
1031,
1033,
1025,
2005,
1006,
16994,
25888,
14074,
1999,
1049,
4974,
2545,
1007,
1063,
3805,
2545,
1027,
3805,
2545... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js | createElementWithClassName | function createElementWithClassName(type, className) {
var elm = document.createElement(type);
elm.className = className;
return elm;
} | javascript | function createElementWithClassName(type, className) {
var elm = document.createElement(type);
elm.className = className;
return elm;
} | [
"function",
"createElementWithClassName",
"(",
"type",
",",
"className",
")",
"{",
"var",
"elm",
"=",
"document",
".",
"createElement",
"(",
"type",
")",
";",
"elm",
".",
"className",
"=",
"className",
";",
"return",
"elm",
";",
"}"
] | Creates an element of a specified type with a specified class name.
@param {string} type The node type.
@param {string} className The class name to use.
@return {Element} The created element. | [
"Creates",
"an",
"element",
"of",
"a",
"specified",
"type",
"with",
"a",
"specified",
"class",
"name",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js#L264-L268 | train | Creates an element with the given type and class name. | [
30522,
3853,
3443,
12260,
3672,
24415,
26266,
18442,
1006,
2828,
1010,
2465,
18442,
1007,
1063,
13075,
17709,
1027,
6254,
1012,
3443,
12260,
3672,
1006,
2828,
1007,
1025,
17709,
1012,
2465,
18442,
1027,
2465,
18442,
1025,
2709,
17709,
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/extensibility/ExtensionManager.js | markForDisabling | function markForDisabling(id, mark) {
if (mark) {
_idsToDisable[id] = true;
} else {
delete _idsToDisable[id];
}
exports.trigger("statusChange", id);
} | javascript | function markForDisabling(id, mark) {
if (mark) {
_idsToDisable[id] = true;
} else {
delete _idsToDisable[id];
}
exports.trigger("statusChange", id);
} | [
"function",
"markForDisabling",
"(",
"id",
",",
"mark",
")",
"{",
"if",
"(",
"mark",
")",
"{",
"_idsToDisable",
"[",
"id",
"]",
"=",
"true",
";",
"}",
"else",
"{",
"delete",
"_idsToDisable",
"[",
"id",
"]",
";",
"}",
"exports",
".",
"trigger",
"(",
... | Marks an extension for disabling later, or unmarks an extension previously marked.
@param {string} id The id of the extension
@param {boolean} mark Whether to mark or unmark the extension. | [
"Marks",
"an",
"extension",
"for",
"disabling",
"later",
"or",
"unmarks",
"an",
"extension",
"previously",
"marked",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/ExtensionManager.js#L543-L550 | train | Mark a phrase for disabling | [
30522,
3853,
2928,
3877,
14268,
9709,
1006,
8909,
1010,
2928,
1007,
1063,
2065,
1006,
2928,
1007,
1063,
1035,
8909,
16033,
10521,
3085,
1031,
8909,
1033,
1027,
2995,
1025,
1065,
2842,
1063,
3972,
12870,
1035,
8909,
16033,
10521,
3085,
1031,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ipfs/js-ipfs | examples/exchange-files-in-browser/public/app.js | connectToPeer | function connectToPeer (event) {
const multiaddr = $multiaddrInput.value
if (!multiaddr) {
return onError('No multiaddr was inserted.')
}
node.swarm.connect(multiaddr)
.then(() => {
onSuccess(`Successfully connected to peer.`)
$multiaddrInput.value = ''
})
.catch(() => onError('An ... | javascript | function connectToPeer (event) {
const multiaddr = $multiaddrInput.value
if (!multiaddr) {
return onError('No multiaddr was inserted.')
}
node.swarm.connect(multiaddr)
.then(() => {
onSuccess(`Successfully connected to peer.`)
$multiaddrInput.value = ''
})
.catch(() => onError('An ... | [
"function",
"connectToPeer",
"(",
"event",
")",
"{",
"const",
"multiaddr",
"=",
"$multiaddrInput",
".",
"value",
"if",
"(",
"!",
"multiaddr",
")",
"{",
"return",
"onError",
"(",
"'No multiaddr was inserted.'",
")",
"}",
"node",
".",
"swarm",
".",
"connect",
... | /* ===========================================================================
Peers handling
=========================================================================== | [
"/",
"*",
"===========================================================================",
"Peers",
"handling",
"==========================================================================="
] | 97e67601094acda3906549ecb0248fd09f1a8cc3 | https://github.com/ipfs/js-ipfs/blob/97e67601094acda3906549ecb0248fd09f1a8cc3/examples/exchange-files-in-browser/public/app.js#L253-L266 | train | connects to peer | [
30522,
3853,
7532,
14399,
11510,
1006,
2724,
1007,
1063,
9530,
3367,
4800,
4215,
13626,
1027,
1002,
4800,
4215,
13626,
2378,
18780,
1012,
3643,
2065,
1006,
999,
4800,
4215,
13626,
1007,
1063,
2709,
2028,
18933,
2099,
1006,
1005,
2053,
4800,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
PrismJS/prism | components/prism-javadoclike.js | addSupport | function addSupport(languages, docLanguage) {
if (typeof languages === 'string') {
languages = [languages];
}
languages.forEach(function (lang) {
docCommentSupport(lang, function (pattern) {
if (!pattern.inside) {
pattern.inside = {};
}
pattern.inside.rest = docLanguage;
});
});
} | javascript | function addSupport(languages, docLanguage) {
if (typeof languages === 'string') {
languages = [languages];
}
languages.forEach(function (lang) {
docCommentSupport(lang, function (pattern) {
if (!pattern.inside) {
pattern.inside = {};
}
pattern.inside.rest = docLanguage;
});
});
} | [
"function",
"addSupport",
"(",
"languages",
",",
"docLanguage",
")",
"{",
"if",
"(",
"typeof",
"languages",
"===",
"'string'",
")",
"{",
"languages",
"=",
"[",
"languages",
"]",
";",
"}",
"languages",
".",
"forEach",
"(",
"function",
"(",
"lang",
")",
"{... | Adds doc-comment support to the given languages for the given documentation language.
@param {string[]|string} languages
@param {Object} docLanguage | [
"Adds",
"doc",
"-",
"comment",
"support",
"to",
"the",
"given",
"languages",
"for",
"the",
"given",
"documentation",
"language",
"."
] | acceb3b56f0e8362a7ef274dbd85b17611df2ec4 | https://github.com/PrismJS/prism/blob/acceb3b56f0e8362a7ef274dbd85b17611df2ec4/components/prism-javadoclike.js#L67-L80 | train | Add support for doc - comment | [
30522,
3853,
9909,
6279,
6442,
1006,
4155,
1010,
9986,
25023,
6692,
3351,
1007,
1063,
2065,
1006,
2828,
11253,
4155,
1027,
1027,
1027,
1005,
5164,
1005,
1007,
1063,
4155,
1027,
1031,
4155,
1033,
1025,
1065,
4155,
1012,
18921,
6776,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
pixijs/pixi.js | packages/prepare/src/Prepare.js | uploadBaseTextures | function uploadBaseTextures(renderer, item)
{
if (item instanceof BaseTexture)
{
// if the texture already has a GL texture, then the texture has been prepared or rendered
// before now. If the texture changed, then the changer should be calling texture.update() which
// reuploads the te... | javascript | function uploadBaseTextures(renderer, item)
{
if (item instanceof BaseTexture)
{
// if the texture already has a GL texture, then the texture has been prepared or rendered
// before now. If the texture changed, then the changer should be calling texture.update() which
// reuploads the te... | [
"function",
"uploadBaseTextures",
"(",
"renderer",
",",
"item",
")",
"{",
"if",
"(",
"item",
"instanceof",
"BaseTexture",
")",
"{",
"// if the texture already has a GL texture, then the texture has been prepared or rendered",
"// before now. If the texture changed, then the changer s... | Built-in hook to upload PIXI.Texture objects to the GPU.
@private
@param {PIXI.Renderer} renderer - instance of the webgl renderer
@param {PIXI.DisplayObject} item - Item to check
@return {boolean} If item was uploaded. | [
"Built",
"-",
"in",
"hook",
"to",
"upload",
"PIXI",
".",
"Texture",
"objects",
"to",
"the",
"GPU",
"."
] | 99ae03b7565ae7ca5a6de633b0a277f7128fa4d0 | https://github.com/pixijs/pixi.js/blob/99ae03b7565ae7ca5a6de633b0a277f7128fa4d0/packages/prepare/src/Prepare.js#L39-L55 | train | upload base textures | [
30522,
3853,
2039,
11066,
15058,
18209,
14900,
1006,
17552,
2121,
1010,
8875,
1007,
1063,
2065,
1006,
8875,
6013,
11253,
2918,
18209,
5397,
1007,
1063,
1013,
1013,
2065,
1996,
14902,
2525,
2038,
1037,
1043,
2140,
14902,
1010,
2059,
1996,
14... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js | registerNodeFunctions | function registerNodeFunctions() {
functionMap["node.downloadInstaller"] = downloadInstaller;
functionMap["node.performCleanup"] = performCleanup;
functionMap["node.validateInstaller"] = validateChecksum;
functionMap["node.initializeState"] = initializeState;
functionMap["node.ch... | javascript | function registerNodeFunctions() {
functionMap["node.downloadInstaller"] = downloadInstaller;
functionMap["node.performCleanup"] = performCleanup;
functionMap["node.validateInstaller"] = validateChecksum;
functionMap["node.initializeState"] = initializeState;
functionMap["node.ch... | [
"function",
"registerNodeFunctions",
"(",
")",
"{",
"functionMap",
"[",
"\"node.downloadInstaller\"",
"]",
"=",
"downloadInstaller",
";",
"functionMap",
"[",
"\"node.performCleanup\"",
"]",
"=",
"performCleanup",
";",
"functionMap",
"[",
"\"node.validateInstaller\"",
"]",... | Generates a map for node side functions | [
"Generates",
"a",
"map",
"for",
"node",
"side",
"functions"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js#L405-L412 | train | Register node functions | [
30522,
3853,
4236,
3630,
3207,
11263,
27989,
2015,
1006,
1007,
1063,
3853,
2863,
2361,
1031,
1000,
13045,
1012,
8816,
7076,
9080,
3917,
1000,
1033,
1027,
8816,
7076,
9080,
3917,
1025,
3853,
2863,
2361,
1031,
1000,
13045,
1012,
4685,
14321,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
laurent22/joplin | ElectronClient/app/main.js | envFromArgs | function envFromArgs(args) {
if (!args) return 'prod';
const envIndex = args.indexOf('--env');
const devIndex = args.indexOf('dev');
if (envIndex === devIndex - 1) return 'dev';
return 'prod';
} | javascript | function envFromArgs(args) {
if (!args) return 'prod';
const envIndex = args.indexOf('--env');
const devIndex = args.indexOf('dev');
if (envIndex === devIndex - 1) return 'dev';
return 'prod';
} | [
"function",
"envFromArgs",
"(",
"args",
")",
"{",
"if",
"(",
"!",
"args",
")",
"return",
"'prod'",
";",
"const",
"envIndex",
"=",
"args",
".",
"indexOf",
"(",
"'--env'",
")",
";",
"const",
"devIndex",
"=",
"args",
".",
"indexOf",
"(",
"'dev'",
")",
"... | Flags are parsed properly in BaseApplication, however it's better to have the env as early as possible to enable debugging capabilities. | [
"Flags",
"are",
"parsed",
"properly",
"in",
"BaseApplication",
"however",
"it",
"s",
"better",
"to",
"have",
"the",
"env",
"as",
"early",
"as",
"possible",
"to",
"enable",
"debugging",
"capabilities",
"."
] | beb428b246cecba4630a3ca57b472f43c0933a43 | https://github.com/laurent22/joplin/blob/beb428b246cecba4630a3ca57b472f43c0933a43/ElectronClient/app/main.js#L19-L25 | train | Get the environment from the args | [
30522,
3853,
4372,
2615,
19699,
30524,
1005,
1007,
1025,
9530,
3367,
23601,
3207,
2595,
1027,
12098,
5620,
1012,
5950,
11253,
1006,
1005,
16475,
1005,
1007,
1025,
2065,
1006,
4372,
6371,
3207,
2595,
1027,
1027,
1027,
23601,
3207,
2595,
1011... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensibility/node/ExtensionManagerDomain.js | function (error, response, body) {
if (error) {
// Usually means we never got a response - server is down, no DNS entry, etc.
_endDownload(downloadId, Errors.NO_SERVER_RESPONSE);
return;
}
if (response.statusCode !== 200) {
... | javascript | function (error, response, body) {
if (error) {
// Usually means we never got a response - server is down, no DNS entry, etc.
_endDownload(downloadId, Errors.NO_SERVER_RESPONSE);
return;
}
if (response.statusCode !== 200) {
... | [
"function",
"(",
"error",
",",
"response",
",",
"body",
")",
"{",
"if",
"(",
"error",
")",
"{",
"// Usually means we never got a response - server is down, no DNS entry, etc.",
"_endDownload",
"(",
"downloadId",
",",
"Errors",
".",
"NO_SERVER_RESPONSE",
")",
";",
"ret... | Note: we could use the traditional "response"/"data"/"end" events too if we wanted to stream data incrementally, limit download size, etc. - but the simple callback is good enough for our needs. | [
"Note",
":",
"we",
"could",
"use",
"the",
"traditional",
"response",
"/",
"data",
"/",
"end",
"events",
"too",
"if",
"we",
"wanted",
"to",
"stream",
"data",
"incrementally",
"limit",
"download",
"size",
"etc",
".",
"-",
"but",
"the",
"simple",
"callback",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/ExtensionManagerDomain.js#L405-L426 | train | Called when the download is complete | [
30522,
3853,
1006,
7561,
1010,
3433,
1010,
2303,
1007,
1063,
2065,
1006,
7561,
1007,
1063,
1013,
1013,
2788,
2965,
2057,
2196,
2288,
1037,
3433,
1011,
8241,
2003,
2091,
1010,
2053,
1040,
3619,
4443,
1010,
4385,
1012,
1035,
2203,
7698,
110... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SheetJS/js-xlsx | xlsx.js | parse_wb_bin | function parse_wb_bin(data, opts) {
var wb = { AppVersion:{}, WBProps:{}, WBView:[], Sheets:[], CalcPr:{}, xmlns: "" };
var state = [];
var pass = false;
if(!opts) opts = {};
opts.biff = 12;
var Names = [];
var supbooks = ([[]]);
supbooks.SheetNames = [];
supbooks.XTI = [];
recordhopper(data, function hopp... | javascript | function parse_wb_bin(data, opts) {
var wb = { AppVersion:{}, WBProps:{}, WBView:[], Sheets:[], CalcPr:{}, xmlns: "" };
var state = [];
var pass = false;
if(!opts) opts = {};
opts.biff = 12;
var Names = [];
var supbooks = ([[]]);
supbooks.SheetNames = [];
supbooks.XTI = [];
recordhopper(data, function hopp... | [
"function",
"parse_wb_bin",
"(",
"data",
",",
"opts",
")",
"{",
"var",
"wb",
"=",
"{",
"AppVersion",
":",
"{",
"}",
",",
"WBProps",
":",
"{",
"}",
",",
"WBView",
":",
"[",
"]",
",",
"Sheets",
":",
"[",
"]",
",",
"CalcPr",
":",
"{",
"}",
",",
... | /* [MS-XLSB] 2.1.7.61 Workbook | [
"/",
"*",
"[",
"MS",
"-",
"XLSB",
"]",
"2",
".",
"1",
".",
"7",
".",
"61",
"Workbook"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L14854-L14956 | train | Parse a binary file. | [
30522,
3853,
11968,
3366,
1035,
25610,
1035,
8026,
1006,
2951,
1010,
23569,
2015,
1007,
1063,
13075,
25610,
1027,
1063,
10439,
27774,
1024,
1063,
1065,
1010,
25610,
21572,
4523,
1024,
1063,
1065,
1010,
25610,
8584,
1024,
1031,
1033,
1010,
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... |
aws/aws-sdk-js | lib/xml/xml-node.js | XmlNode | function XmlNode(name, children) {
if (children === void 0) { children = []; }
this.name = name;
this.children = children;
this.attributes = {};
} | javascript | function XmlNode(name, children) {
if (children === void 0) { children = []; }
this.name = name;
this.children = children;
this.attributes = {};
} | [
"function",
"XmlNode",
"(",
"name",
",",
"children",
")",
"{",
"if",
"(",
"children",
"===",
"void",
"0",
")",
"{",
"children",
"=",
"[",
"]",
";",
"}",
"this",
".",
"name",
"=",
"name",
";",
"this",
".",
"children",
"=",
"children",
";",
"this",
... | Represents an XML node.
@api private | [
"Represents",
"an",
"XML",
"node",
"."
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/xml/xml-node.js#L7-L12 | train | A node in a node tree | [
30522,
3853,
20950,
3630,
3207,
1006,
2171,
1010,
2336,
1007,
1063,
2065,
1006,
2336,
1027,
1027,
1027,
11675,
1014,
1007,
1063,
2336,
1027,
1031,
1033,
1025,
1065,
2023,
1012,
2171,
1027,
2171,
1025,
2023,
1012,
2336,
1027,
2336,
1025,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.support/src/sap/ui/support/supportRules/ui/controllers/Analysis.controller.js | function (component, savedComponents) {
for (var index = 0; index < savedComponents.length; index += 1) {
if (savedComponents[index].text == component.text && savedComponents[index].selected) {
return true;
}
}
return false;
} | javascript | function (component, savedComponents) {
for (var index = 0; index < savedComponents.length; index += 1) {
if (savedComponents[index].text == component.text && savedComponents[index].selected) {
return true;
}
}
return false;
} | [
"function",
"(",
"component",
",",
"savedComponents",
")",
"{",
"for",
"(",
"var",
"index",
"=",
"0",
";",
"index",
"<",
"savedComponents",
".",
"length",
";",
"index",
"+=",
"1",
")",
"{",
"if",
"(",
"savedComponents",
"[",
"index",
"]",
".",
"text",
... | Checks if given execution scope component is selected comparing against an array of settings
@param {Object} component The current component object to be checked
@param {Array} savedComponents The local storage settings for the checked execution scope components
@returns {boolean} If the component is checked or not | [
"Checks",
"if",
"given",
"execution",
"scope",
"component",
"is",
"selected",
"comparing",
"against",
"an",
"array",
"of",
"settings"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.support/src/sap/ui/support/supportRules/ui/controllers/Analysis.controller.js#L348-L355 | train | Check if a component is selected in the saved list | [
30522,
3853,
1006,
6922,
1010,
5552,
9006,
29513,
7666,
1007,
1063,
2005,
1006,
13075,
5950,
1027,
1014,
1025,
5950,
1026,
5552,
9006,
29513,
7666,
1012,
3091,
1025,
5950,
1009,
1027,
1015,
1007,
1063,
2065,
1006,
5552,
9006,
29513,
7666,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
keplergl/kepler.gl | src/reducers/vis-state-updaters.js | generateLayerMetaForSplitViews | function generateLayerMetaForSplitViews(layer) {
return {
isAvailable: layer.config.isVisible,
isVisible: layer.config.isVisible
};
} | javascript | function generateLayerMetaForSplitViews(layer) {
return {
isAvailable: layer.config.isVisible,
isVisible: layer.config.isVisible
};
} | [
"function",
"generateLayerMetaForSplitViews",
"(",
"layer",
")",
"{",
"return",
"{",
"isAvailable",
":",
"layer",
".",
"config",
".",
"isVisible",
",",
"isVisible",
":",
"layer",
".",
"config",
".",
"isVisible",
"}",
";",
"}"
] | /* eslint-enable max-statements | [
"/",
"*",
"eslint",
"-",
"enable",
"max",
"-",
"statements"
] | 779238435707cc54335c2d00001e4b9334b314aa | https://github.com/keplergl/kepler.gl/blob/779238435707cc54335c2d00001e4b9334b314aa/src/reducers/vis-state-updaters.js#L1081-L1086 | train | Generate meta for a layer for split views | [
30522,
3853,
9699,
24314,
11368,
10354,
5668,
24759,
4183,
8584,
2015,
1006,
6741,
1007,
1063,
2709,
1063,
18061,
3567,
11733,
3468,
1024,
6741,
1012,
9530,
8873,
2290,
1012,
2003,
11365,
7028,
1010,
2003,
11365,
7028,
1024,
6741,
1012,
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... |
keplergl/kepler.gl | examples/replace-component/src/components/side-bar.js | CustomSidebarFactory | function CustomSidebarFactory(CloseButton) {
const SideBar = SidebarFactory(CloseButton);
const CustomSidebar = (props) => (
<StyledSideBarContainer>
<SideBar {...props}/>
</StyledSideBarContainer>
);
return CustomSidebar;
} | javascript | function CustomSidebarFactory(CloseButton) {
const SideBar = SidebarFactory(CloseButton);
const CustomSidebar = (props) => (
<StyledSideBarContainer>
<SideBar {...props}/>
</StyledSideBarContainer>
);
return CustomSidebar;
} | [
"function",
"CustomSidebarFactory",
"(",
"CloseButton",
")",
"{",
"const",
"SideBar",
"=",
"SidebarFactory",
"(",
"CloseButton",
")",
";",
"const",
"CustomSidebar",
"=",
"(",
"props",
")",
"=>",
"(",
"<",
"StyledSideBarContainer",
">",
"\n ",
"<",
"SideBar"... | Custom sidebar will render kepler.gl default side bar adding a wrapper component to edit its style | [
"Custom",
"sidebar",
"will",
"render",
"kepler",
".",
"gl",
"default",
"side",
"bar",
"adding",
"a",
"wrapper",
"component",
"to",
"edit",
"its",
"style"
] | 779238435707cc54335c2d00001e4b9334b314aa | https://github.com/keplergl/kepler.gl/blob/779238435707cc54335c2d00001e4b9334b314aa/examples/replace-component/src/components/side-bar.js#L72-L80 | train | Custom Sidebar factory | [
30522,
3853,
8205,
5178,
8237,
21450,
1006,
2485,
8569,
15474,
1007,
1063,
9530,
3367,
2217,
8237,
1027,
30524,
8237,
8663,
18249,
2121,
1028,
1026,
2217,
8237,
1063,
1012,
1012,
1012,
24387,
1065,
1013,
1028,
1026,
1013,
13650,
7363,
8237,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/DebugCommands/NodeDebugUtils.js | restartNode | function restartNode() {
try {
_nodeConnection.domains.base.restartNode();
} catch (e) {
window.alert("Failed trying to restart Node: " + e.message);
}
} | javascript | function restartNode() {
try {
_nodeConnection.domains.base.restartNode();
} catch (e) {
window.alert("Failed trying to restart Node: " + e.message);
}
} | [
"function",
"restartNode",
"(",
")",
"{",
"try",
"{",
"_nodeConnection",
".",
"domains",
".",
"base",
".",
"restartNode",
"(",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"window",
".",
"alert",
"(",
"\"Failed trying to restart Node: \"",
"+",
"e",
".",
... | Sends a command to node to cause a restart. | [
"Sends",
"a",
"command",
"to",
"node",
"to",
"cause",
"a",
"restart",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/DebugCommands/NodeDebugUtils.js#L64-L70 | train | restart the node | [
30522,
3853,
23818,
3630,
3207,
1006,
1007,
1063,
3046,
1063,
1035,
13045,
8663,
2638,
7542,
1012,
13100,
1012,
2918,
1012,
23818,
3630,
3207,
1006,
1007,
1025,
1065,
4608,
1006,
1041,
1007,
1063,
3332,
1012,
9499,
1006,
1000,
3478,
2667,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | mxCellAttributeChange | function mxCellAttributeChange(cell, attribute, value)
{
this.cell = cell;
this.attribute = attribute;
this.value = value;
this.previous = value;
} | javascript | function mxCellAttributeChange(cell, attribute, value)
{
this.cell = cell;
this.attribute = attribute;
this.value = value;
this.previous = value;
} | [
"function",
"mxCellAttributeChange",
"(",
"cell",
",",
"attribute",
",",
"value",
")",
"{",
"this",
".",
"cell",
"=",
"cell",
";",
"this",
".",
"attribute",
"=",
"attribute",
";",
"this",
".",
"value",
"=",
"value",
";",
"this",
".",
"previous",
"=",
"... | Class: mxCellAttributeChange
Action to change the attribute of a cell's user object.
There is no method on the graph model that uses this
action. To use the action, you can use the code shown
in the example below.
Example:
To change the attributeName in the cell's user object
to attributeValue, use the following cod... | [
"Class",
":",
"mxCellAttributeChange"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L41934-L41940 | train | This method is called when the attribute of a cell changes | [
30522,
3853,
25630,
29109,
20051,
18886,
8569,
15007,
22043,
1006,
3526,
1010,
17961,
1010,
3643,
1007,
1063,
2023,
1012,
3526,
1027,
3526,
1025,
2023,
1012,
17961,
1027,
17961,
1025,
2023,
1012,
3643,
1027,
3643,
1025,
2023,
1012,
3025,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/util/ast-utils.js | getUpperFunction | function getUpperFunction(node) {
for (let currentNode = node; currentNode; currentNode = currentNode.parent) {
if (anyFunctionPattern.test(currentNode.type)) {
return currentNode;
}
}
return null;
} | javascript | function getUpperFunction(node) {
for (let currentNode = node; currentNode; currentNode = currentNode.parent) {
if (anyFunctionPattern.test(currentNode.type)) {
return currentNode;
}
}
return null;
} | [
"function",
"getUpperFunction",
"(",
"node",
")",
"{",
"for",
"(",
"let",
"currentNode",
"=",
"node",
";",
"currentNode",
";",
"currentNode",
"=",
"currentNode",
".",
"parent",
")",
"{",
"if",
"(",
"anyFunctionPattern",
".",
"test",
"(",
"currentNode",
".",
... | Finds a function node from ancestors of a node.
@param {ASTNode} node - A start node to find.
@returns {Node|null} A found function node. | [
"Finds",
"a",
"function",
"node",
"from",
"ancestors",
"of",
"a",
"node",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/util/ast-utils.js#L87-L94 | train | Get the upper function of a node | [
30522,
3853,
2131,
29547,
12881,
4609,
7542,
1006,
13045,
1007,
1063,
2005,
1006,
2292,
2783,
3630,
3207,
1027,
13045,
1025,
2783,
3630,
3207,
1025,
2783,
3630,
3207,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
goldfire/howler.js | examples/3d/js/camera.js | function(col, ray, angle) {
var step, drops, rain, texX, wall;
var tex1 = game.map.wall;
var tex2 = game.map.speaker;
var left = Math.floor(col * this.spacing);
var width = Math.ceil(this.spacing);
var hit = -1;
// Find the next wall hit.
while (++hit < ray.length && ray[hit].height <= ... | javascript | function(col, ray, angle) {
var step, drops, rain, texX, wall;
var tex1 = game.map.wall;
var tex2 = game.map.speaker;
var left = Math.floor(col * this.spacing);
var width = Math.ceil(this.spacing);
var hit = -1;
// Find the next wall hit.
while (++hit < ray.length && ray[hit].height <= ... | [
"function",
"(",
"col",
",",
"ray",
",",
"angle",
")",
"{",
"var",
"step",
",",
"drops",
",",
"rain",
",",
"texX",
",",
"wall",
";",
"var",
"tex1",
"=",
"game",
".",
"map",
".",
"wall",
";",
"var",
"tex2",
"=",
"game",
".",
"map",
".",
"speaker... | Draw a single column of the scene.
@param {Number} col Which column in the sequence.
@param {Array} ray Ray to follow.
@param {Number} angle Angle of the ray. | [
"Draw",
"a",
"single",
"column",
"of",
"the",
"scene",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/examples/3d/js/camera.js#L76-L113 | train | Draw the ray of the game. map. wall and the speaker. | [
30522,
3853,
1006,
8902,
1010,
4097,
1010,
6466,
1007,
1063,
13075,
3357,
1010,
9010,
1010,
4542,
1010,
16060,
2595,
1010,
2813,
1025,
13075,
16060,
2487,
1027,
2208,
1012,
4949,
1012,
2813,
1025,
13075,
16060,
2475,
1027,
2208,
1012,
4949,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | _setStatus | function _setStatus(status, closeReason) {
// Don't send a notification when the status didn't actually change
if (status === exports.status) {
return;
}
exports.status = status;
var reason = status === STATUS_INACTIVE ? closeReason : null;
exports.trigger("... | javascript | function _setStatus(status, closeReason) {
// Don't send a notification when the status didn't actually change
if (status === exports.status) {
return;
}
exports.status = status;
var reason = status === STATUS_INACTIVE ? closeReason : null;
exports.trigger("... | [
"function",
"_setStatus",
"(",
"status",
",",
"closeReason",
")",
"{",
"// Don't send a notification when the status didn't actually change",
"if",
"(",
"status",
"===",
"exports",
".",
"status",
")",
"{",
"return",
";",
"}",
"exports",
".",
"status",
"=",
"status",... | Update the status. Triggers a statusChange event.
@param {number} status new status
@param {?string} closeReason Optional string key suffix to display to
user when closing the live development connection (see LIVE_DEV_* keys) | [
"Update",
"the",
"status",
".",
"Triggers",
"a",
"statusChange",
"event",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevMultiBrowser.js#L201-L211 | train | Sets the status of the cluster | [
30522,
3853,
1035,
4520,
29336,
2271,
1006,
3570,
1010,
3553,
5243,
3385,
1007,
1063,
1013,
1013,
2123,
1005,
1056,
4604,
1037,
26828,
2043,
1996,
3570,
2134,
1005,
1056,
2941,
2689,
2065,
1006,
3570,
1027,
1027,
1027,
14338,
1012,
3570,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ExactList.js | function(oList, oAttribute, iSelectedIndex, bSkipNotify){
oList._lb.removeSelectedIndex(iSelectedIndex);
oAttribute._clearSelection();
if (!bSkipNotify) {
var aSubLists = oList.getSubLists();
for (var i = 0; i < aSubLists.length; i++) {
if (aSubLists[i].getData() === oAttribute.getId()) {
close(aSu... | javascript | function(oList, oAttribute, iSelectedIndex, bSkipNotify){
oList._lb.removeSelectedIndex(iSelectedIndex);
oAttribute._clearSelection();
if (!bSkipNotify) {
var aSubLists = oList.getSubLists();
for (var i = 0; i < aSubLists.length; i++) {
if (aSubLists[i].getData() === oAttribute.getId()) {
close(aSu... | [
"function",
"(",
"oList",
",",
"oAttribute",
",",
"iSelectedIndex",
",",
"bSkipNotify",
")",
"{",
"oList",
".",
"_lb",
".",
"removeSelectedIndex",
"(",
"iSelectedIndex",
")",
";",
"oAttribute",
".",
"_clearSelection",
"(",
")",
";",
"if",
"(",
"!",
"bSkipNot... | Sets the selection property of the given attribute and all its sub-attributes to false. Additionally the given index in the lists ListBox is unselected. ExactLists which corresponds to the cleared attributes are closed if bSkipNotify is not set. | [
"Sets",
"the",
"selection",
"property",
"of",
"the",
"given",
"attribute",
"and",
"all",
"its",
"sub",
"-",
"attributes",
"to",
"false",
".",
"Additionally",
"the",
"given",
"index",
"in",
"the",
"lists",
"ListBox",
"is",
"unselected",
".",
"ExactLists",
"wh... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L1426-L1437 | train | Removes the selected attribute from the list | [
30522,
3853,
1006,
19330,
2923,
1010,
1051,
19321,
3089,
8569,
2618,
1010,
2003,
12260,
10985,
22254,
10288,
1010,
18667,
3211,
2361,
17048,
8757,
1007,
1063,
19330,
2923,
1012,
1035,
6053,
1012,
20362,
12260,
10985,
22254,
10288,
1006,
2003,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.fl/src/sap/ui/fl/context/ContextManager.js | function(oContext, aRuntimeContextParameters) {
var that = this;
var bContextActive = true;
var aParameterOfContext = oContext.parameters;
aParameterOfContext.every(function (oParameter) {
bContextActive = bContextActive && that._checkContextParameter(oParameter, aRuntimeContextParameters);
return ... | javascript | function(oContext, aRuntimeContextParameters) {
var that = this;
var bContextActive = true;
var aParameterOfContext = oContext.parameters;
aParameterOfContext.every(function (oParameter) {
bContextActive = bContextActive && that._checkContextParameter(oParameter, aRuntimeContextParameters);
return ... | [
"function",
"(",
"oContext",
",",
"aRuntimeContextParameters",
")",
"{",
"var",
"that",
"=",
"this",
";",
"var",
"bContextActive",
"=",
"true",
";",
"var",
"aParameterOfContext",
"=",
"oContext",
".",
"parameters",
";",
"aParameterOfContext",
".",
"every",
"(",
... | Helper to filter passed context object.
If a passed context is not within the context objects of the given application the context is filtered.
The filtering is done
[At runtime] by comparing the parameters of the context objects with the actual runtime context.
[At designtime] by comparing the id of the context objec... | [
"Helper",
"to",
"filter",
"passed",
"context",
"object",
".",
"If",
"a",
"passed",
"context",
"is",
"not",
"within",
"the",
"context",
"objects",
"of",
"the",
"given",
"application",
"the",
"context",
"is",
"filtered",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/context/ContextManager.js#L147-L158 | train | Checks if the given context has parameters | [
30522,
3853,
1006,
1051,
8663,
18209,
1010,
28217,
7292,
8663,
18209,
28689,
22828,
2015,
1007,
1063,
13075,
2008,
1027,
2023,
1025,
13075,
4647,
28040,
18413,
19620,
1027,
2995,
1025,
13075,
9706,
5400,
22828,
11253,
8663,
18209,
1027,
1051,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SheetJS/js-xlsx | xlsx.js | parse_PtgArray | function parse_PtgArray(blob, length, opts) {
var type = (blob[blob.l++] & 0x60) >> 5;
blob.l += opts.biff == 2 ? 6 : opts.biff == 12 ? 14 : 7;
return [type];
} | javascript | function parse_PtgArray(blob, length, opts) {
var type = (blob[blob.l++] & 0x60) >> 5;
blob.l += opts.biff == 2 ? 6 : opts.biff == 12 ? 14 : 7;
return [type];
} | [
"function",
"parse_PtgArray",
"(",
"blob",
",",
"length",
",",
"opts",
")",
"{",
"var",
"type",
"=",
"(",
"blob",
"[",
"blob",
".",
"l",
"++",
"]",
"&",
"0x60",
")",
">>",
"5",
";",
"blob",
".",
"l",
"+=",
"opts",
".",
"biff",
"==",
"2",
"?",
... | /* [MS-XLS] 2.5.198.32 ; [MS-XLSB] 2.5.97.23 | [
"/",
"*",
"[",
"MS",
"-",
"XLS",
"]",
"2",
".",
"5",
".",
"198",
".",
"32",
";",
"[",
"MS",
"-",
"XLSB",
"]",
"2",
".",
"5",
".",
"97",
".",
"23"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L10351-L10355 | train | parse_PtgArray - Parse an Array of PTGs | [
30522,
3853,
11968,
3366,
1035,
13866,
6843,
9447,
1006,
1038,
4135,
2497,
1010,
3091,
1010,
23569,
2015,
1007,
1063,
13075,
2828,
1027,
1006,
1038,
4135,
2497,
1031,
1038,
4135,
2497,
1012,
1048,
1009,
1009,
1033,
1004,
1014,
2595,
16086,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperExpression.js | function (oInterface, oPathValue, sEdmType) {
var sValue = oPathValue.value;
Basics.expectType(oPathValue, "string");
if (sEdmType === "String") {
if (rI18n.test(sValue)) { // a simple binding to "@i18n" model
return {
ignoreTypeInPath : true,
result : "binding",
type : "Edm.String... | javascript | function (oInterface, oPathValue, sEdmType) {
var sValue = oPathValue.value;
Basics.expectType(oPathValue, "string");
if (sEdmType === "String") {
if (rI18n.test(sValue)) { // a simple binding to "@i18n" model
return {
ignoreTypeInPath : true,
result : "binding",
type : "Edm.String... | [
"function",
"(",
"oInterface",
",",
"oPathValue",
",",
"sEdmType",
")",
"{",
"var",
"sValue",
"=",
"oPathValue",
".",
"value",
";",
"Basics",
".",
"expectType",
"(",
"oPathValue",
",",
"\"string\"",
")",
";",
"if",
"(",
"sEdmType",
"===",
"\"String\"",
")"... | Handling of "14.4 Constant Expressions", i.e.
<ul>
<li>"14.4.2 Expression edm:Bool",</li>
<li>"14.4.3 Expression edm:Date",</li>
<li>"14.4.4 Expression edm:DateTimeOffset",</li>
<li>"14.4.5 Expression edm:Decimal",</li>
<li>"14.4.8 Expression edm:Float",</li>
<li>"14.4.9 Expression edm:Guid",</li>
<li>"14.4.10 Expressi... | [
"Handling",
"of",
"14",
".",
"4",
"Constant",
"Expressions",
"i",
".",
"e",
".",
"<ul",
">",
"<li",
">",
"14",
".",
"4",
".",
"2",
"Expression",
"edm",
":",
"Bool",
"<",
"/",
"li",
">",
"<li",
">",
"14",
".",
"4",
".",
"3",
"Expression",
"edm",... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperExpression.js#L282-L325 | train | Returns an object with the binding type and value | [
30522,
3853,
1006,
1051,
18447,
2121,
12172,
1010,
6728,
8988,
10175,
5657,
1010,
7367,
22117,
13874,
1007,
1063,
13075,
17917,
2389,
5657,
1027,
6728,
8988,
10175,
5657,
1012,
3643,
1025,
24078,
1012,
5987,
13874,
1006,
6728,
8988,
10175,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
fex-team/webuploader | dist/webuploader.withoutimage.js | function( type ) {
var args, events, allEvents;
if ( !this._events || !type ) {
return this;
}
args = slice.call( arguments, 1 );
events = findHandlers( this._events, type );
allEvents = findHan... | javascript | function( type ) {
var args, events, allEvents;
if ( !this._events || !type ) {
return this;
}
args = slice.call( arguments, 1 );
events = findHandlers( this._events, type );
allEvents = findHan... | [
"function",
"(",
"type",
")",
"{",
"var",
"args",
",",
"events",
",",
"allEvents",
";",
"if",
"(",
"!",
"this",
".",
"_events",
"||",
"!",
"type",
")",
"{",
"return",
"this",
";",
"}",
"args",
"=",
"slice",
".",
"call",
"(",
"arguments",
",",
"1"... | 触发事件
@method trigger
@grammar trigger( name[, args...] ) => self
@param {String} type 事件名
@param {*} [...] 任意参数
@return {Boolean} 如果handler中return false了,则返回false, 否则返回true | [
"触发事件"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/dist/webuploader.withoutimage.js#L673-L686 | train | Trigger event handlers | [
30522,
3853,
1006,
2828,
1007,
1063,
13075,
12098,
5620,
1010,
2824,
1010,
2035,
18697,
7666,
30524,
2424,
11774,
12910,
1006,
2023,
1012,
1035,
2824,
1010,
1005,
2035,
1005,
1007,
1025,
2709,
9495,
11774,
2545,
1006,
2824,
1010,
12098,
562... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | dist/js/materialize.js | function () {
if (typeof _this14.options.onOpenEnd === 'function') {
_this14.options.onOpenEnd.call(_this14, _this14.el, _this14._openingTrigger);
}
} | javascript | function () {
if (typeof _this14.options.onOpenEnd === 'function') {
_this14.options.onOpenEnd.call(_this14, _this14.el, _this14._openingTrigger);
}
} | [
"function",
"(",
")",
"{",
"if",
"(",
"typeof",
"_this14",
".",
"options",
".",
"onOpenEnd",
"===",
"'function'",
")",
"{",
"_this14",
".",
"options",
".",
"onOpenEnd",
".",
"call",
"(",
"_this14",
",",
"_this14",
".",
"el",
",",
"_this14",
".",
"_open... | Handle modal onOpenEnd callback | [
"Handle",
"modal",
"onOpenEnd",
"callback"
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/dist/js/materialize.js#L3085-L3089 | train | onOpenEnd callback | [
30522,
3853,
1006,
1007,
1063,
2065,
1006,
2828,
11253,
1035,
2023,
16932,
1012,
7047,
1012,
21058,
11837,
10497,
1027,
1027,
1027,
1005,
3853,
1005,
30524,
1035,
2023,
16932,
1010,
1035,
2023,
16932,
1012,
3449,
1010,
1035,
2023,
16932,
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/preferences/PreferencesManager.js | _setProjectSettingsFile | function _setProjectSettingsFile(settingsFile) {
projectDirectory = FileUtils.getDirectoryPath(settingsFile);
_toggleProjectScope();
PreferencesImpl.projectPathLayer.setPrefFilePath(settingsFile);
PreferencesImpl.projectStorage.setPath(settingsFile);
} | javascript | function _setProjectSettingsFile(settingsFile) {
projectDirectory = FileUtils.getDirectoryPath(settingsFile);
_toggleProjectScope();
PreferencesImpl.projectPathLayer.setPrefFilePath(settingsFile);
PreferencesImpl.projectStorage.setPath(settingsFile);
} | [
"function",
"_setProjectSettingsFile",
"(",
"settingsFile",
")",
"{",
"projectDirectory",
"=",
"FileUtils",
".",
"getDirectoryPath",
"(",
"settingsFile",
")",
";",
"_toggleProjectScope",
"(",
")",
";",
"PreferencesImpl",
".",
"projectPathLayer",
".",
"setPrefFilePath",
... | @private
This is used internally within Brackets for the ProjectManager to signal
which file contains the project-level preferences.
@param {string} settingsFile Full path to the project's settings file | [
"@private"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesManager.js#L101-L106 | train | Set project settings file | [
30522,
3853,
1035,
2275,
21572,
20614,
21678,
8613,
8873,
2571,
1006,
10906,
8873,
2571,
1007,
1063,
2622,
4305,
2890,
16761,
2100,
1027,
5371,
21823,
4877,
1012,
2131,
4305,
2890,
16761,
22571,
8988,
1006,
10906,
8873,
2571,
1007,
1025,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.dt/src/sap/ui/dt/ContextMenuControl.js | function (oContPos, oPopover, oViewport) {
this.getPopover().setShowArrow(true);
var oPos = {};
//Popover should appear at the top (if place available)
this.getPopover().setPlacement(PlacementType.PreferredTopOrFlip);
var iBtnWidth = oPopover.width / this._iButtonsVisible;
oPos.left = oContPos.x + (... | javascript | function (oContPos, oPopover, oViewport) {
this.getPopover().setShowArrow(true);
var oPos = {};
//Popover should appear at the top (if place available)
this.getPopover().setPlacement(PlacementType.PreferredTopOrFlip);
var iBtnWidth = oPopover.width / this._iButtonsVisible;
oPos.left = oContPos.x + (... | [
"function",
"(",
"oContPos",
",",
"oPopover",
",",
"oViewport",
")",
"{",
"this",
".",
"getPopover",
"(",
")",
".",
"setShowArrow",
"(",
"true",
")",
";",
"var",
"oPos",
"=",
"{",
"}",
";",
"//Popover should appear at the top (if place available)",
"this",
"."... | Works out how the ContextMenu shall be placed
@param {object} oOverlay the dimensions of the overlay
@param {object} oPopover the dimensions of the popover
@param {object} oViewport the dimensions of the viewport
@return {object} the position of the "fakeDiv" | [
"Works",
"out",
"how",
"the",
"ContextMenu",
"shall",
"be",
"placed"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.dt/src/sap/ui/dt/ContextMenuControl.js#L433-L464 | train | Calculates the position of the popover in the right border of the context menu. | [
30522,
3853,
1006,
1051,
8663,
25856,
2891,
1010,
6728,
7361,
7840,
1010,
1051,
8584,
6442,
1007,
1063,
2023,
1012,
2131,
16340,
7840,
1006,
1007,
1012,
4520,
14406,
2906,
10524,
1006,
2995,
1007,
1025,
13075,
6728,
2891,
1027,
1063,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
elastic/elasticsearch-js | api/index.js | lazyLoad | function lazyLoad (file, opts) {
var fn = null
return function _lazyLoad (params, options, callback) {
if (fn === null) {
fn = require(`./api/${file}.js`)(opts)
}
return fn(params, options, callback)
}
} | javascript | function lazyLoad (file, opts) {
var fn = null
return function _lazyLoad (params, options, callback) {
if (fn === null) {
fn = require(`./api/${file}.js`)(opts)
}
return fn(params, options, callback)
}
} | [
"function",
"lazyLoad",
"(",
"file",
",",
"opts",
")",
"{",
"var",
"fn",
"=",
"null",
"return",
"function",
"_lazyLoad",
"(",
"params",
",",
"options",
",",
"callback",
")",
"{",
"if",
"(",
"fn",
"===",
"null",
")",
"{",
"fn",
"=",
"require",
"(",
... | It's unlikely that a user needs all of our APIs, and since require is a sync operation that takes time (given the amount of APIs we have), let's lazy load them, so a given API file will be required only if the user actually needs that API. The following implementation takes advantage of js closures to have a simple cac... | [
"It",
"s",
"unlikely",
"that",
"a",
"user",
"needs",
"all",
"of",
"our",
"APIs",
"and",
"since",
"require",
"is",
"a",
"sync",
"operation",
"that",
"takes",
"time",
"(",
"given",
"the",
"amount",
"of",
"APIs",
"we",
"have",
")",
"let",
"s",
"lazy",
"... | 4fc4699a4d4474d7887bc7757e0269218a859294 | https://github.com/elastic/elasticsearch-js/blob/4fc4699a4d4474d7887bc7757e0269218a859294/api/index.js#L547-L555 | train | lazyLoad function | [
30522,
3853,
13971,
11066,
1006,
5371,
1010,
23569,
2015,
1007,
1063,
13075,
1042,
2078,
1027,
19701,
2709,
3853,
1035,
13971,
11066,
1006,
11498,
5244,
1010,
7047,
1010,
2655,
5963,
1007,
1063,
2065,
1006,
1042,
2078,
1027,
1027,
1027,
197... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.uxap/src/sap/uxap/component/ObjectPageComponentContainer.js | function () {
this._oComponent = sap.ui.component("sap.uxap");
if (!this._oComponent) {
this._oComponent = sap.ui.component({
name: this.getName(),
url: this.getUrl(),
componentData: { //forward configuration to underlying component
jsonConfigurationURL: this.getJsonConf... | javascript | function () {
this._oComponent = sap.ui.component("sap.uxap");
if (!this._oComponent) {
this._oComponent = sap.ui.component({
name: this.getName(),
url: this.getUrl(),
componentData: { //forward configuration to underlying component
jsonConfigurationURL: this.getJsonConf... | [
"function",
"(",
")",
"{",
"this",
".",
"_oComponent",
"=",
"sap",
".",
"ui",
".",
"component",
"(",
"\"sap.uxap\"",
")",
";",
"if",
"(",
"!",
"this",
".",
"_oComponent",
")",
"{",
"this",
".",
"_oComponent",
"=",
"sap",
".",
"ui",
".",
"component",
... | this ComponentContainer is working only with one component: the objectPageLayout
unlike the standard ComponentContainer, this ones exposes properties to the outside world and pass them on to the underlying component | [
"this",
"ComponentContainer",
"is",
"working",
"only",
"with",
"one",
"component",
":",
"the",
"objectPageLayout",
"unlike",
"the",
"standard",
"ComponentContainer",
"this",
"ones",
"exposes",
"properties",
"to",
"the",
"outside",
"world",
"and",
"pass",
"them",
"... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.uxap/src/sap/uxap/component/ObjectPageComponentContainer.js#L34-L53 | train | Creates the component if not exists | [
30522,
3853,
1006,
1007,
1063,
2023,
1012,
1035,
1051,
9006,
29513,
3372,
1027,
20066,
1012,
21318,
1012,
6922,
1006,
1000,
20066,
1012,
1057,
18684,
2361,
1000,
1007,
1025,
2065,
1006,
999,
2023,
1012,
1035,
1051,
9006,
29513,
3372,
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... | |
Dogfalo/materialize | extras/noUiSlider/nouislider.js | eventMove | function eventMove ( event, data ) {
// Fix #498
// Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).
// https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero
... | javascript | function eventMove ( event, data ) {
// Fix #498
// Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).
// https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero
... | [
"function",
"eventMove",
"(",
"event",
",",
"data",
")",
"{",
"// Fix #498",
"// Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).",
"// https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove... | Handle movement on document for handle and range drag. | [
"Handle",
"movement",
"on",
"document",
"for",
"handle",
"and",
"range",
"drag",
"."
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/extras/noUiSlider/nouislider.js#L1484-L1502 | train | eventMove eventMove eventMove | [
30522,
3853,
2724,
5302,
3726,
1006,
2724,
1010,
2951,
1007,
1063,
1013,
1013,
8081,
1001,
4749,
2620,
1013,
1013,
4638,
3643,
1997,
1012,
11287,
1999,
1005,
2707,
1005,
2000,
2147,
2105,
1037,
11829,
1999,
29464,
10790,
4684,
1006,
2951,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fex-team/webuploader | dist/webuploader.withoutimage.js | Uploader | function Uploader( opts ) {
this.options = $.extend( true, {}, Uploader.options, opts );
this._init( this.options );
} | javascript | function Uploader( opts ) {
this.options = $.extend( true, {}, Uploader.options, opts );
this._init( this.options );
} | [
"function",
"Uploader",
"(",
"opts",
")",
"{",
"this",
".",
"options",
"=",
"$",
".",
"extend",
"(",
"true",
",",
"{",
"}",
",",
"Uploader",
".",
"options",
",",
"opts",
")",
";",
"this",
".",
"_init",
"(",
"this",
".",
"options",
")",
";",
"}"
] | 上传入口类。
@class Uploader
@constructor
@grammar new Uploader( opts ) => Uploader
@example
var uploader = WebUploader.Uploader({
swf: 'path_of_swf/Uploader.swf',
// 开起分片上传。
chunked: true
}); | [
"上传入口类。",
"@class",
"Uploader",
"@constructor",
"@grammar",
"new",
"Uploader",
"(",
"opts",
")",
"=",
">",
"Uploader",
"@example",
"var",
"uploader",
"=",
"WebUploader",
".",
"Uploader",
"(",
"{",
"swf",
":",
"path_of_swf",
"/",
"Uploader",
".",
"swf"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/dist/webuploader.withoutimage.js#L732-L735 | train | Constructor for Uploader | [
30522,
3853,
2039,
11066,
2121,
1006,
23569,
2015,
1007,
1063,
2023,
1012,
7047,
1027,
1002,
1012,
7949,
1006,
2995,
1010,
1063,
1065,
1010,
2039,
11066,
2121,
1012,
7047,
1010,
23569,
2015,
1007,
1025,
2023,
1012,
1035,
1999,
4183,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/datajs.js | function (dom, namespaceURI, qualifiedName, value) {
/// <summary>Creates a new DOM attribute node.</summary>
/// <param name="dom">DOM document used to create the attribute.</param>
/// <param name="prefix" type="String">Namespace prefix.</param>
/// <param name="namespaceURI" type="Str... | javascript | function (dom, namespaceURI, qualifiedName, value) {
/// <summary>Creates a new DOM attribute node.</summary>
/// <param name="dom">DOM document used to create the attribute.</param>
/// <param name="prefix" type="String">Namespace prefix.</param>
/// <param name="namespaceURI" type="Str... | [
"function",
"(",
"dom",
",",
"namespaceURI",
",",
"qualifiedName",
",",
"value",
")",
"{",
"/// <summary>Creates a new DOM attribute node.</summary>",
"/// <param name=\"dom\">DOM document used to create the attribute.</param>",
"/// <param name=\"prefix\" type=\"String\">Namespace prefix.... | ##### END: MODIFIED BY SAP | [
"#####",
"END",
":",
"MODIFIED",
"BY",
"SAP"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/datajs.js#L979-L996 | train | Creates an attribute node for the given namespace declaration. | [
30522,
3853,
1006,
14383,
1010,
3415,
15327,
9496,
1010,
4591,
18442,
1010,
3643,
1007,
1063,
1013,
1013,
1013,
1026,
12654,
1028,
9005,
1037,
2047,
14383,
17961,
13045,
1012,
1026,
1013,
12654,
1028,
1013,
1013,
1013,
1026,
11498,
2213,
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... | |
SAP/openui5 | src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/util/IndexWorker.js | overrideLunrTokenizer | function overrideLunrTokenizer() {
var origTokenizer = lunr.tokenizer;
var rSeparators = /[-./#_,;\(\)=><|]/g;
lunr.tokenizer = function(str) {
return origTokenizer.call(lunr, str).reduce( function (result, token) {
if ( rSeparators.test(token) ) {
token = token.replace(rSeparators, " ");
resul... | javascript | function overrideLunrTokenizer() {
var origTokenizer = lunr.tokenizer;
var rSeparators = /[-./#_,;\(\)=><|]/g;
lunr.tokenizer = function(str) {
return origTokenizer.call(lunr, str).reduce( function (result, token) {
if ( rSeparators.test(token) ) {
token = token.replace(rSeparators, " ");
resul... | [
"function",
"overrideLunrTokenizer",
"(",
")",
"{",
"var",
"origTokenizer",
"=",
"lunr",
".",
"tokenizer",
";",
"var",
"rSeparators",
"=",
"/",
"[-./#_,;\\(\\)=><|]",
"/",
"g",
";",
"lunr",
".",
"tokenizer",
"=",
"function",
"(",
"str",
")",
"{",
"return",
... | overrides the lunr tokenizer in order to define custom token separators | [
"overrides",
"the",
"lunr",
"tokenizer",
"in",
"order",
"to",
"define",
"custom",
"token",
"separators"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/util/IndexWorker.js#L231-L250 | train | Override lunr. tokenizer with lowercased tokens | [
30522,
3853,
2058,
15637,
26896,
5339,
11045,
3490,
6290,
1006,
1007,
1063,
13075,
2030,
8004,
18715,
18595,
6290,
1027,
11320,
16118,
1012,
19204,
17629,
1025,
13075,
12667,
13699,
25879,
5668,
1027,
1013,
1031,
1011,
1012,
1013,
1001,
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... |
moleculerjs/moleculer | src/transporters/index.js | resolve | function resolve(opt) {
if (opt instanceof Transporters.Base) {
return opt;
} else if (_.isString(opt)) {
let TransporterClass = getByName(opt);
if (TransporterClass)
return new TransporterClass();
if (opt.startsWith("nats://"))
TransporterClass = Transporters.NATS;
else if (opt.startsWith("mqtt://")... | javascript | function resolve(opt) {
if (opt instanceof Transporters.Base) {
return opt;
} else if (_.isString(opt)) {
let TransporterClass = getByName(opt);
if (TransporterClass)
return new TransporterClass();
if (opt.startsWith("nats://"))
TransporterClass = Transporters.NATS;
else if (opt.startsWith("mqtt://")... | [
"function",
"resolve",
"(",
"opt",
")",
"{",
"if",
"(",
"opt",
"instanceof",
"Transporters",
".",
"Base",
")",
"{",
"return",
"opt",
";",
"}",
"else",
"if",
"(",
"_",
".",
"isString",
"(",
"opt",
")",
")",
"{",
"let",
"TransporterClass",
"=",
"getByN... | Resolve transporter by name
@param {object|string} opt
@returns {Transporter} | [
"Resolve",
"transporter",
"by",
"name"
] | f95aadc2d61b0d0e3c643a43c3ed28bca6425cde | https://github.com/moleculerjs/moleculer/blob/f95aadc2d61b0d0e3c643a43c3ed28bca6425cde/src/transporters/index.js#L40-L78 | train | Resolves a transporter | [
30522,
30524,
1007,
1007,
1063,
2292,
3665,
2121,
26266,
1027,
2131,
3762,
18442,
1006,
23569,
1007,
1025,
2065,
1006,
3665,
2121,
26266,
1007,
2709,
2047,
3665,
2121,
26266,
1006,
1007,
1025,
2065,
1006,
23569,
1012,
4627,
24415,
1006,
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... |
muaz-khan/RecordRTC | WebGL-Recording/view.js | recordCanvasUsingRecordRTC | function recordCanvasUsingRecordRTC(canvas) {
var recorder = RecordRTC(canvas, {
type: 'canvas',
showMousePointer: true
});
recorder.startRecording();
setTimeout(function() {
recorder.stopRecording(function(url) {
var blob = recorder.getBlob();
console.log('blob', blob);
... | javascript | function recordCanvasUsingRecordRTC(canvas) {
var recorder = RecordRTC(canvas, {
type: 'canvas',
showMousePointer: true
});
recorder.startRecording();
setTimeout(function() {
recorder.stopRecording(function(url) {
var blob = recorder.getBlob();
console.log('blob', blob);
... | [
"function",
"recordCanvasUsingRecordRTC",
"(",
"canvas",
")",
"{",
"var",
"recorder",
"=",
"RecordRTC",
"(",
"canvas",
",",
"{",
"type",
":",
"'canvas'",
",",
"showMousePointer",
":",
"true",
"}",
")",
";",
"recorder",
".",
"startRecording",
"(",
")",
";",
... | RecordRTC ========= | [
"RecordRTC",
"========="
] | 3c6bad427b9da35c1cf617199ed13dda056c38ba | https://github.com/muaz-khan/RecordRTC/blob/3c6bad427b9da35c1cf617199ed13dda056c38ba/WebGL-Recording/view.js#L325-L348 | train | record canvas using RecordRTC | [
30522,
3853,
2501,
9336,
12044,
18161,
2890,
27108,
13626,
13535,
1006,
10683,
1007,
1063,
13075,
14520,
1027,
2501,
5339,
2278,
1006,
10683,
1010,
1063,
2828,
1024,
1005,
10683,
1005,
1010,
2265,
27711,
13699,
25785,
2121,
1024,
2995,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
openlayers/openlayers | examples/zoomslider.js | createMap | function createMap(divId) {
const source = new OSM();
const layer = new TileLayer({
source: source
});
const map = new Map({
layers: [layer],
target: divId,
view: new View({
center: [0, 0],
zoom: 2
})
});
const zoomslider = new ZoomSlider();
map.addControl(zoomslider);
re... | javascript | function createMap(divId) {
const source = new OSM();
const layer = new TileLayer({
source: source
});
const map = new Map({
layers: [layer],
target: divId,
view: new View({
center: [0, 0],
zoom: 2
})
});
const zoomslider = new ZoomSlider();
map.addControl(zoomslider);
re... | [
"function",
"createMap",
"(",
"divId",
")",
"{",
"const",
"source",
"=",
"new",
"OSM",
"(",
")",
";",
"const",
"layer",
"=",
"new",
"TileLayer",
"(",
"{",
"source",
":",
"source",
"}",
")",
";",
"const",
"map",
"=",
"new",
"Map",
"(",
"{",
"layers"... | Helper method for map-creation.
@param {string} divId The id of the div for the map.
@return {Map} The map instance. | [
"Helper",
"method",
"for",
"map",
"-",
"creation",
"."
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/examples/zoomslider.js#L14-L30 | train | Create a map | [
30522,
3853,
3443,
2863,
2361,
1006,
4487,
17258,
1007,
1063,
9530,
3367,
3120,
1027,
2047,
9808,
2213,
1006,
1007,
1025,
9530,
3367,
6741,
1027,
2047,
14090,
24314,
1006,
1063,
3120,
1024,
3120,
1065,
1007,
1025,
9530,
3367,
4949,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/dom/jquery/Focusable.js | findFocusableDomRef | function findFocusableDomRef(oContainer, bForward) {
var oChild = bForward ? oContainer.firstChild : oContainer.lastChild,
oFocusableDescendant;
while (oChild) {
if ( oChild.nodeType == 1 && !isHidden(oChild) ) {
if ( jQuery(oChild).hasTabIndex() ) {
return oChild;
}
oFocusableDescendant... | javascript | function findFocusableDomRef(oContainer, bForward) {
var oChild = bForward ? oContainer.firstChild : oContainer.lastChild,
oFocusableDescendant;
while (oChild) {
if ( oChild.nodeType == 1 && !isHidden(oChild) ) {
if ( jQuery(oChild).hasTabIndex() ) {
return oChild;
}
oFocusableDescendant... | [
"function",
"findFocusableDomRef",
"(",
"oContainer",
",",
"bForward",
")",
"{",
"var",
"oChild",
"=",
"bForward",
"?",
"oContainer",
".",
"firstChild",
":",
"oContainer",
".",
"lastChild",
",",
"oFocusableDescendant",
";",
"while",
"(",
"oChild",
")",
"{",
"i... | Searches for a descendant of the given node that is an Element and focusable and visible.
The search is executed 'depth first'.
@param {Node} oContainer Node to search for a focusable descendant
@param {boolean} bForward Whether to search forward (true) or backwards (false)
@returns {Element} Element node that is foc... | [
"Searches",
"for",
"a",
"descendant",
"of",
"the",
"given",
"node",
"that",
"is",
"an",
"Element",
"and",
"focusable",
"and",
"visible",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/dom/jquery/Focusable.js#L49-L74 | train | Finds the first child of the given container that has a tabindex attribute. | [
30522,
3853,
2424,
14876,
7874,
3085,
9527,
2890,
2546,
1006,
1051,
8663,
18249,
2121,
1010,
28939,
2953,
7652,
1007,
1063,
13075,
28166,
4014,
2094,
1027,
28939,
2953,
7652,
1029,
1051,
8663,
18249,
2121,
1012,
2034,
19339,
1024,
1051,
866... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
material-components/material-components-web-react | scripts/release/cp-pkgs.js | addTsIgnore | function addTsIgnore(filePath) {
const data = fs.readFileSync(filePath).toString().split('\n');
const lineNumber = data.findIndex((lineText) => lineText.includes('/dist/'));
if (lineNumber <= -1) return;
data.splice(lineNumber, 0, '// @ts-ignore');
const text = data.join('\n');
fs.writeFile(filePath, text,... | javascript | function addTsIgnore(filePath) {
const data = fs.readFileSync(filePath).toString().split('\n');
const lineNumber = data.findIndex((lineText) => lineText.includes('/dist/'));
if (lineNumber <= -1) return;
data.splice(lineNumber, 0, '// @ts-ignore');
const text = data.join('\n');
fs.writeFile(filePath, text,... | [
"function",
"addTsIgnore",
"(",
"filePath",
")",
"{",
"const",
"data",
"=",
"fs",
".",
"readFileSync",
"(",
"filePath",
")",
".",
"toString",
"(",
")",
".",
"split",
"(",
"'\\n'",
")",
";",
"const",
"lineNumber",
"=",
"data",
".",
"findIndex",
"(",
"("... | this takes a file path to an index.d.ts file and adds an //@ts-ignore comment above the MDC Web imports (any line that includes `/dist/`). We need to ignore these lines since MDC Web does not have typing files TODO: https://github.com/material-components/material-components-web-react/issues/574 | [
"this",
"takes",
"a",
"file",
"path",
"to",
"an",
"index",
".",
"d",
".",
"ts",
"file",
"and",
"adds",
"an",
"//"
] | 5ee9df0982d6cff893523c3e1e447b0f98bf8611 | https://github.com/material-components/material-components-web-react/blob/5ee9df0982d6cff893523c3e1e447b0f98bf8611/scripts/release/cp-pkgs.js#L82-L92 | train | Add ts - ignore to a file | [
30522,
3853,
5587,
3215,
23773,
5686,
1006,
5371,
15069,
1007,
1063,
9530,
3367,
2951,
1027,
1042,
2015,
1012,
3191,
8873,
4244,
6038,
2278,
1006,
5371,
15069,
1007,
1012,
2000,
3367,
4892,
1006,
1007,
1012,
3975,
1006,
1005,
1032,
1050,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
wix/react-native-ui-lib | scripts/utils/propTypesHandler.js | propTypesDocsHandler | function propTypesDocsHandler(documentation, path) {
const propTypesPath = getMemberValuePath(path, 'propTypes');
const docComment = getDocblock(propTypesPath.parent);
const statementPattern = /@.*\:/;
const info = {};
if (docComment) {
const infoRaw = _.split(docComment, '\n');
_.forEach(infoRaw, (s... | javascript | function propTypesDocsHandler(documentation, path) {
const propTypesPath = getMemberValuePath(path, 'propTypes');
const docComment = getDocblock(propTypesPath.parent);
const statementPattern = /@.*\:/;
const info = {};
if (docComment) {
const infoRaw = _.split(docComment, '\n');
_.forEach(infoRaw, (s... | [
"function",
"propTypesDocsHandler",
"(",
"documentation",
",",
"path",
")",
"{",
"const",
"propTypesPath",
"=",
"getMemberValuePath",
"(",
"path",
",",
"'propTypes'",
")",
";",
"const",
"docComment",
"=",
"getDocblock",
"(",
"propTypesPath",
".",
"parent",
")",
... | Extract info on the component props | [
"Extract",
"info",
"on",
"the",
"component",
"props"
] | 439d36c7932bc3cfe574320e8f214a03f988c5ac | https://github.com/wix/react-native-ui-lib/blob/439d36c7932bc3cfe574320e8f214a03f988c5ac/scripts/utils/propTypesHandler.js#L10-L26 | train | PropTypes docs handler | [
30522,
3853,
17678,
13874,
16150,
10085,
9688,
21222,
1006,
12653,
1010,
4130,
1007,
1063,
9530,
3367,
17678,
13874,
13102,
8988,
1027,
2131,
4168,
21784,
10175,
5657,
15069,
1006,
4130,
1010,
1005,
17678,
13874,
2015,
1005,
1007,
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... |
eslint/eslint | lib/rules/space-infix-ops.js | checkVar | function checkVar(node) {
const leftNode = (node.id.typeAnnotation) ? node.id.typeAnnotation : node.id;
const rightNode = node.init;
if (rightNode) {
const nonSpacedNode = getFirstNonSpacedToken(leftNode, rightNode, "=");
if (nonSpacedNode) {
... | javascript | function checkVar(node) {
const leftNode = (node.id.typeAnnotation) ? node.id.typeAnnotation : node.id;
const rightNode = node.init;
if (rightNode) {
const nonSpacedNode = getFirstNonSpacedToken(leftNode, rightNode, "=");
if (nonSpacedNode) {
... | [
"function",
"checkVar",
"(",
"node",
")",
"{",
"const",
"leftNode",
"=",
"(",
"node",
".",
"id",
".",
"typeAnnotation",
")",
"?",
"node",
".",
"id",
".",
"typeAnnotation",
":",
"node",
".",
"id",
";",
"const",
"rightNode",
"=",
"node",
".",
"init",
"... | Check if the node is a variable
@param {ASTNode} node node to evaluate
@returns {void}
@private | [
"Check",
"if",
"the",
"node",
"is",
"a",
"variable"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/space-infix-ops.js#L142-L153 | train | Check if variable is valid | [
30522,
3853,
4638,
10755,
1006,
13045,
1007,
1063,
9530,
3367,
2187,
3630,
3207,
1027,
1006,
13045,
1012,
8909,
1012,
2828,
11639,
17287,
3508,
1007,
1029,
13045,
1012,
8909,
1012,
2828,
11639,
17287,
3508,
1024,
13045,
1012,
8909,
1025,
95... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/language/XMLUtils.js | _getTagAttributeValue | function _getTagAttributeValue(editor, pos) {
var ctx, tagName, attrName, exclusionList = [], offset, textBefore, textAfter;
ctx = TokenUtils.getInitialContext(editor._codeMirror, pos);
offset = TokenUtils.offsetInToken(ctx);
// To support multiple options on the same attribute, we hav... | javascript | function _getTagAttributeValue(editor, pos) {
var ctx, tagName, attrName, exclusionList = [], offset, textBefore, textAfter;
ctx = TokenUtils.getInitialContext(editor._codeMirror, pos);
offset = TokenUtils.offsetInToken(ctx);
// To support multiple options on the same attribute, we hav... | [
"function",
"_getTagAttributeValue",
"(",
"editor",
",",
"pos",
")",
"{",
"var",
"ctx",
",",
"tagName",
",",
"attrName",
",",
"exclusionList",
"=",
"[",
"]",
",",
"offset",
",",
"textBefore",
",",
"textAfter",
";",
"ctx",
"=",
"TokenUtils",
".",
"getInitia... | Return the tag name, attribute name and a list of options used by the attribute
@param {!Editor} editor An instance of active editor
@param {!{line: number, ch: number}} pos Position of cursor in the editor
@return {!{tagName: string, attrName: string, exclusionList: Array.<string>}} | [
"Return",
"the",
"tag",
"name",
"attribute",
"name",
"and",
"a",
"list",
"of",
"options",
"used",
"by",
"the",
"attribute"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/XMLUtils.js#L156-L220 | train | Get the value of a tag attribute | [
30522,
3853,
1035,
2131,
15900,
19321,
3089,
8569,
2618,
10175,
5657,
1006,
3559,
1010,
13433,
2015,
1007,
1063,
13075,
14931,
2595,
1010,
6415,
18442,
1010,
2012,
16344,
18442,
1010,
15945,
9863,
1027,
1031,
1033,
1010,
16396,
1010,
3793,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sparksuite/simplemde-markdown-editor | src/js/simplemde.js | togglePreview | function togglePreview(editor) {
var cm = editor.codemirror;
var wrapper = cm.getWrapperElement();
var toolbar_div = wrapper.previousSibling;
var toolbar = editor.options.toolbar ? editor.toolbarElements.preview : false;
var preview = wrapper.lastChild;
if(!preview || !/editor-preview/.test(preview.className)) {
... | javascript | function togglePreview(editor) {
var cm = editor.codemirror;
var wrapper = cm.getWrapperElement();
var toolbar_div = wrapper.previousSibling;
var toolbar = editor.options.toolbar ? editor.toolbarElements.preview : false;
var preview = wrapper.lastChild;
if(!preview || !/editor-preview/.test(preview.className)) {
... | [
"function",
"togglePreview",
"(",
"editor",
")",
"{",
"var",
"cm",
"=",
"editor",
".",
"codemirror",
";",
"var",
"wrapper",
"=",
"cm",
".",
"getWrapperElement",
"(",
")",
";",
"var",
"toolbar_div",
"=",
"wrapper",
".",
"previousSibling",
";",
"var",
"toolb... | Preview action. | [
"Preview",
"action",
"."
] | 6abda7ab68cc20f4aca870eb243747951b90ab04 | https://github.com/sparksuite/simplemde-markdown-editor/blob/6abda7ab68cc20f4aca870eb243747951b90ab04/src/js/simplemde.js#L752-L789 | train | Toggle the preview of the editor | [
30522,
3853,
2000,
24679,
28139,
8584,
1006,
3559,
1007,
1063,
13075,
4642,
1027,
3559,
1012,
3642,
14503,
29165,
1025,
13075,
10236,
4842,
30524,
1012,
7047,
1012,
6994,
8237,
1029,
3559,
1012,
6994,
8237,
12260,
8163,
1012,
19236,
1024,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/jquery.sap.history.js | findRouteByIdentifier | function findRouteByIdentifier(sIdf){
var i;
for (i = 0 ; i < routes.length ; i++) {
if (routes[i].sIdentifier === sIdf) {
return routes[i];
}
}
} | javascript | function findRouteByIdentifier(sIdf){
var i;
for (i = 0 ; i < routes.length ; i++) {
if (routes[i].sIdentifier === sIdf) {
return routes[i];
}
}
} | [
"function",
"findRouteByIdentifier",
"(",
"sIdf",
")",
"{",
"var",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"routes",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"routes",
"[",
"i",
"]",
".",
"sIdentifier",
"===",
"sIdf",
")",
... | This function returns the route object matched by the identifier passed as parameter.
@private | [
"This",
"function",
"returns",
"the",
"route",
"object",
"matched",
"by",
"the",
"identifier",
"passed",
"as",
"parameter",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/jquery.sap.history.js#L675-L682 | train | Find a route by its identifier | [
30522,
3853,
2424,
22494,
2618,
3762,
5178,
16778,
8873,
2121,
1006,
15765,
2546,
1007,
1063,
13075,
1045,
1025,
2005,
1006,
1045,
1027,
1014,
1025,
1045,
1026,
5847,
1012,
3091,
1025,
1045,
1009,
1009,
1007,
1063,
2065,
1006,
5847,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
wuchangming/spy-debugger | buildin_modules/weinre/web/index.js | getTargetBookmarklet | function getTargetBookmarklet() {
var script = targetBookmarkletFunction.toString();
script = script.replace(/\n/g, "")
script = script.replace("targetBookmarkletFunction","")
script = script.replace(/\s*/g, "")
script = script.replace("???", buildHttpURL("target/target-script-min.js#" + weinre_id... | javascript | function getTargetBookmarklet() {
var script = targetBookmarkletFunction.toString();
script = script.replace(/\n/g, "")
script = script.replace("targetBookmarkletFunction","")
script = script.replace(/\s*/g, "")
script = script.replace("???", buildHttpURL("target/target-script-min.js#" + weinre_id... | [
"function",
"getTargetBookmarklet",
"(",
")",
"{",
"var",
"script",
"=",
"targetBookmarkletFunction",
".",
"toString",
"(",
")",
";",
"script",
"=",
"script",
".",
"replace",
"(",
"/",
"\\n",
"/",
"g",
",",
"\"\"",
")",
"script",
"=",
"script",
".",
"rep... | ----------------------------------------------------------------------------- | [
"-----------------------------------------------------------------------------"
] | 55c1dda0dff0c44920673711656ddfd7ff03c307 | https://github.com/wuchangming/spy-debugger/blob/55c1dda0dff0c44920673711656ddfd7ff03c307/buildin_modules/weinre/web/index.js#L84-L92 | train | Get the target bookmarklet | [
30522,
3853,
2131,
7559,
18150,
8654,
10665,
7485,
1006,
1007,
1063,
13075,
5896,
1027,
4539,
8654,
10665,
7485,
11263,
27989,
1012,
2000,
3367,
4892,
1006,
1007,
1025,
5896,
1027,
5896,
1012,
5672,
1006,
1013,
1032,
1050,
1013,
1043,
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... |
wuchangming/spy-debugger | buildin_modules/weinre/web/client/Panel.js | processChunk | function processChunk()
{
var view = searchableViews[i];
if (++i >= searchableViews.length) {
if (panel._currentSearchChunkIntervalIdentifier === chunkIntervalIdentifier)
delete panel._currentSearchChunkIntervalIdentifier;
clearInterva... | javascript | function processChunk()
{
var view = searchableViews[i];
if (++i >= searchableViews.length) {
if (panel._currentSearchChunkIntervalIdentifier === chunkIntervalIdentifier)
delete panel._currentSearchChunkIntervalIdentifier;
clearInterva... | [
"function",
"processChunk",
"(",
")",
"{",
"var",
"view",
"=",
"searchableViews",
"[",
"i",
"]",
";",
"if",
"(",
"++",
"i",
">=",
"searchableViews",
".",
"length",
")",
"{",
"if",
"(",
"panel",
".",
"_currentSearchChunkIntervalIdentifier",
"===",
"chunkInter... | Split up the work into chunks so we don't block the UI thread while processing. | [
"Split",
"up",
"the",
"work",
"into",
"chunks",
"so",
"we",
"don",
"t",
"block",
"the",
"UI",
"thread",
"while",
"processing",
"."
] | 55c1dda0dff0c44920673711656ddfd7ff03c307 | https://github.com/wuchangming/spy-debugger/blob/55c1dda0dff0c44920673711656ddfd7ff03c307/buildin_modules/weinre/web/client/Panel.js#L204-L222 | train | processChunk - Process a chunk of searchable views | [
30522,
3853,
2832,
20760,
8950,
1006,
1007,
1063,
13075,
3193,
1027,
3945,
3085,
8584,
2015,
1031,
1045,
1033,
1025,
2065,
1006,
1009,
1009,
1045,
1028,
1027,
3945,
3085,
8584,
2015,
1012,
3091,
1007,
1063,
2065,
1006,
5997,
1012,
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... |
parcel-bundler/parcel | packages/core/parcel-bundler/src/utils/syncPromise.js | syncPromise | function syncPromise(promise) {
let isDone = false;
let res, err;
promise.then(
value => {
res = value;
isDone = true;
},
error => {
err = error;
isDone = true;
}
);
deasync.loopWhile(() => !isDone);
if (err) {
throw err;
}
return res;
} | javascript | function syncPromise(promise) {
let isDone = false;
let res, err;
promise.then(
value => {
res = value;
isDone = true;
},
error => {
err = error;
isDone = true;
}
);
deasync.loopWhile(() => !isDone);
if (err) {
throw err;
}
return res;
} | [
"function",
"syncPromise",
"(",
"promise",
")",
"{",
"let",
"isDone",
"=",
"false",
";",
"let",
"res",
",",
"err",
";",
"promise",
".",
"then",
"(",
"value",
"=>",
"{",
"res",
"=",
"value",
";",
"isDone",
"=",
"true",
";",
"}",
",",
"error",
"=>",
... | Synchronously waits for a promise to return by
yielding to the node event loop as needed. | [
"Synchronously",
"waits",
"for",
"a",
"promise",
"to",
"return",
"by",
"yielding",
"to",
"the",
"node",
"event",
"loop",
"as",
"needed",
"."
] | 84b308511f87d4b69da62bcd352f0ff2f7bd4f1b | https://github.com/parcel-bundler/parcel/blob/84b308511f87d4b69da62bcd352f0ff2f7bd4f1b/packages/core/parcel-bundler/src/utils/syncPromise.js#L7-L29 | train | Sync a promise | [
30522,
3853,
26351,
21572,
28732,
1006,
4872,
1007,
1063,
2292,
2003,
5280,
2063,
1027,
6270,
1025,
2292,
24501,
1010,
9413,
2099,
1025,
4872,
1012,
2059,
1006,
3643,
1027,
1028,
1063,
24501,
1027,
3643,
1025,
2003,
5280,
2063,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/mvc/EventHandlerResolver.js | function(sName, oController) {
var fnHandler;
sName = sName.trim();
if (sap.ui.getCore().getConfiguration().getControllerCodeDeactivated()) {
// When design mode is enabled, controller code is not loaded. That is why we stub the handler functions.
fnHandler = function() {};
} else {
// ... | javascript | function(sName, oController) {
var fnHandler;
sName = sName.trim();
if (sap.ui.getCore().getConfiguration().getControllerCodeDeactivated()) {
// When design mode is enabled, controller code is not loaded. That is why we stub the handler functions.
fnHandler = function() {};
} else {
// ... | [
"function",
"(",
"sName",
",",
"oController",
")",
"{",
"var",
"fnHandler",
";",
"sName",
"=",
"sName",
".",
"trim",
"(",
")",
";",
"if",
"(",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"getConfiguration",
"(",
")",
".",
"getControllerCodeDeactiv... | Helper method to resolve an event handler either locally (from a controller) or globally.
Which contexts are checked for the event handler depends on the syntax of the name:
<ul>
<li><i>relative</i>: names starting with a dot ('.') must specify a handler in
the controller (example: <code>".myLocalHandler"</code>)</li>... | [
"Helper",
"method",
"to",
"resolve",
"an",
"event",
"handler",
"either",
"locally",
"(",
"from",
"a",
"controller",
")",
"or",
"globally",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/mvc/EventHandlerResolver.js#L69-L186 | train | Returns the function that will be called when the event handler is triggered. | [
30522,
3853,
1006,
1055,
18442,
1010,
1051,
8663,
13181,
10820,
1007,
1063,
13075,
1042,
25311,
5685,
3917,
1025,
1055,
18442,
1027,
1055,
18442,
1012,
12241,
1006,
1007,
1025,
2065,
1006,
20066,
1012,
21318,
1012,
2131,
17345,
1006,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
getsentry/sentry-javascript | packages/raven-js/src/raven.js | function() {
var self = this;
var wrappedBuiltIns = self._wrappedBuiltIns;
function wrapTimeFn(orig) {
return function(fn, t) {
// preserve arity
// Make a copy of the arguments to prevent deoptimization
// https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32... | javascript | function() {
var self = this;
var wrappedBuiltIns = self._wrappedBuiltIns;
function wrapTimeFn(orig) {
return function(fn, t) {
// preserve arity
// Make a copy of the arguments to prevent deoptimization
// https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"wrappedBuiltIns",
"=",
"self",
".",
"_wrappedBuiltIns",
";",
"function",
"wrapTimeFn",
"(",
"orig",
")",
"{",
"return",
"function",
"(",
"fn",
",",
"t",
")",
"{",
"// preserve arity",
"/... | Wrap timer functions and event targets to catch errors and provide
better metadata. | [
"Wrap",
"timer",
"functions",
"and",
"event",
"targets",
"to",
"catch",
"errors",
"and",
"provide",
"better",
"metadata",
"."
] | a872223343fecf7364473b78bede937f1eb57bd0 | https://github.com/getsentry/sentry-javascript/blob/a872223343fecf7364473b78bede937f1eb57bd0/packages/raven-js/src/raven.js#L1102-L1308 | train | This function is called by the constructor when the constructor is called. | [
30522,
3853,
1006,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
13075,
5058,
8569,
4014,
7629,
2015,
1027,
2969,
1012,
1035,
5058,
8569,
4014,
7629,
2015,
1025,
3853,
10236,
7292,
2546,
2078,
1006,
2030,
8004,
1007,
1063,
2709,
3853,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
ColorlibHQ/AdminLTE | plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js | function() {
var oldRow = api.getParentElement(this.cell, { nodeName: ["TR"] });
if (oldRow) {
this.setTableMap();
this.idx = this.getMapIndex(this.cell);
if (this.idx !== false) {
var modRow = this.map[this.idx.row];
... | javascript | function() {
var oldRow = api.getParentElement(this.cell, { nodeName: ["TR"] });
if (oldRow) {
this.setTableMap();
this.idx = this.getMapIndex(this.cell);
if (this.idx !== false) {
var modRow = this.map[this.idx.row];
... | [
"function",
"(",
")",
"{",
"var",
"oldRow",
"=",
"api",
".",
"getParentElement",
"(",
"this",
".",
"cell",
",",
"{",
"nodeName",
":",
"[",
"\"TR\"",
"]",
"}",
")",
";",
"if",
"(",
"oldRow",
")",
"{",
"this",
".",
"setTableMap",
"(",
")",
";",
"th... | Removes the row of selected cell | [
"Removes",
"the",
"row",
"of",
"selected",
"cell"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L7935-L7951 | train | remove the TR element | [
30522,
3853,
1006,
1007,
1063,
13075,
2214,
10524,
1027,
17928,
1012,
2131,
19362,
15781,
16930,
4765,
1006,
2023,
1012,
3526,
1010,
1063,
13045,
18442,
1024,
1031,
1000,
19817,
1000,
1033,
1065,
1007,
1025,
2065,
1006,
2214,
10524,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
codemirror/CodeMirror | src/measurement/position_measurement.js | boxIsAfter | function boxIsAfter(box, x, y, left) {
return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x
} | javascript | function boxIsAfter(box, x, y, left) {
return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x
} | [
"function",
"boxIsAfter",
"(",
"box",
",",
"x",
",",
"y",
",",
"left",
")",
"{",
"return",
"box",
".",
"bottom",
"<=",
"y",
"?",
"false",
":",
"box",
".",
"top",
">",
"y",
"?",
"true",
":",
"(",
"left",
"?",
"box",
".",
"left",
":",
"box",
".... | Returns true if the given side of a box is after the given coordinates, in top-to-bottom, left-to-right order. | [
"Returns",
"true",
"if",
"the",
"given",
"side",
"of",
"a",
"box",
"is",
"after",
"the",
"given",
"coordinates",
"in",
"top",
"-",
"to",
"-",
"bottom",
"left",
"-",
"to",
"-",
"right",
"order",
"."
] | dab6f676107c10ba8d16c654a42f66cae3f27db1 | https://github.com/codemirror/CodeMirror/blob/dab6f676107c10ba8d16c654a42f66cae3f27db1/src/measurement/position_measurement.js#L457-L459 | train | Check if a box is after the given x y | [
30522,
3853,
3482,
14268,
6199,
2121,
1006,
3482,
1010,
1060,
1010,
1061,
1010,
2187,
1007,
1063,
2709,
3482,
1012,
3953,
1026,
1027,
1061,
1029,
6270,
1024,
3482,
1012,
2327,
1028,
1061,
1029,
2995,
1024,
1006,
2187,
1029,
3482,
1012,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/CustomizingConfiguration.js | function(oComponent) {
Log.info("CustomizingConfiguration: activateForComponentInstance('" + oComponent.getId() + "')");
var sComponentName = oComponent.getMetadata().getComponentName(),
sKey = sComponentName + "::" + oComponent.getId(),
oCustomizingConfig = oComponent.getManifest()["sap.ui5"] && oCom... | javascript | function(oComponent) {
Log.info("CustomizingConfiguration: activateForComponentInstance('" + oComponent.getId() + "')");
var sComponentName = oComponent.getMetadata().getComponentName(),
sKey = sComponentName + "::" + oComponent.getId(),
oCustomizingConfig = oComponent.getManifest()["sap.ui5"] && oCom... | [
"function",
"(",
"oComponent",
")",
"{",
"Log",
".",
"info",
"(",
"\"CustomizingConfiguration: activateForComponentInstance('\"",
"+",
"oComponent",
".",
"getId",
"(",
")",
"+",
"\"')\"",
")",
";",
"var",
"sComponentName",
"=",
"oComponent",
".",
"getMetadata",
"(... | Activates the Customizing of a component instance by registering the component
configuration in the central Customizing configuration.
@param {sap.ui.core.Component} oComponent the component instance
@private | [
"Activates",
"the",
"Customizing",
"of",
"a",
"component",
"instance",
"by",
"registering",
"the",
"component",
"configuration",
"in",
"the",
"central",
"Customizing",
"configuration",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/CustomizingConfiguration.js#L127-L135 | train | Activates the customizing configuration for the given component | [
30522,
3853,
1006,
1051,
9006,
29513,
3372,
1007,
1063,
8833,
1012,
18558,
1006,
1000,
7661,
6026,
8663,
8873,
27390,
3370,
1024,
20544,
29278,
9006,
29513,
16778,
23808,
6651,
1006,
1005,
1000,
1009,
1051,
9006,
29513,
3372,
1012,
2131,
35... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
ipfs/js-ipfs | src/core/components/files-regular/utils.js | parseRabinString | function parseRabinString (chunker) {
const options = {}
const parts = chunker.split('-')
switch (parts.length) {
case 1:
options.avgChunkSize = 262144
break
case 2:
options.avgChunkSize = parseChunkSize(parts[1], 'avg')
break
case 4:
options.minChunkSize = parseChunkSize... | javascript | function parseRabinString (chunker) {
const options = {}
const parts = chunker.split('-')
switch (parts.length) {
case 1:
options.avgChunkSize = 262144
break
case 2:
options.avgChunkSize = parseChunkSize(parts[1], 'avg')
break
case 4:
options.minChunkSize = parseChunkSize... | [
"function",
"parseRabinString",
"(",
"chunker",
")",
"{",
"const",
"options",
"=",
"{",
"}",
"const",
"parts",
"=",
"chunker",
".",
"split",
"(",
"'-'",
")",
"switch",
"(",
"parts",
".",
"length",
")",
"{",
"case",
"1",
":",
"options",
".",
"avgChunkSi... | Parses rabin chunker string
@param {String} chunker Chunker algorithm supported formats:
"rabin"
"rabin-{avg}"
"rabin-{min}-{avg}-{max}"
@return {Object} rabin chunker options | [
"Parses",
"rabin",
"chunker",
"string"
] | 97e67601094acda3906549ecb0248fd09f1a8cc3 | https://github.com/ipfs/js-ipfs/blob/97e67601094acda3906549ecb0248fd09f1a8cc3/src/core/components/files-regular/utils.js#L70-L90 | train | Parse a rabin chunker string | [
30522,
3853,
11968,
8043,
28518,
23808,
4892,
1006,
20000,
2121,
1007,
1063,
9530,
3367,
7047,
1027,
1063,
1065,
9530,
3367,
3033,
1027,
20000,
2121,
1012,
3975,
1006,
1005,
1011,
1005,
1007,
6942,
1006,
3033,
1012,
3091,
1007,
1063,
2553,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
openlayers/openlayers | tasks/generate-index.js | generateExports | function generateExports(symbols) {
const namespaces = {};
const imports = [];
let blocks = [];
symbols.forEach(function(symbol) {
const name = symbol.name;
if (name.indexOf('#') == -1) {
const imp = getImport(symbol);
if (imp) {
imports[getImport(symbol)] = true;
}
const... | javascript | function generateExports(symbols) {
const namespaces = {};
const imports = [];
let blocks = [];
symbols.forEach(function(symbol) {
const name = symbol.name;
if (name.indexOf('#') == -1) {
const imp = getImport(symbol);
if (imp) {
imports[getImport(symbol)] = true;
}
const... | [
"function",
"generateExports",
"(",
"symbols",
")",
"{",
"const",
"namespaces",
"=",
"{",
"}",
";",
"const",
"imports",
"=",
"[",
"]",
";",
"let",
"blocks",
"=",
"[",
"]",
";",
"symbols",
".",
"forEach",
"(",
"function",
"(",
"symbol",
")",
"{",
"con... | Generate export code given a list symbol names.
@param {Array<Object>} symbols List of symbols.
@param {Object<string, string>} namespaces Already defined namespaces.
@param {Array<string>} imports List of all imports.
@return {string} Export code. | [
"Generate",
"export",
"code",
"given",
"a",
"list",
"symbol",
"names",
"."
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/tasks/generate-index.js#L70-L97 | train | Generate export blocks for symbols | [
30522,
3853,
9699,
10288,
25378,
1006,
9255,
1007,
1063,
9530,
3367,
3415,
15327,
2015,
1027,
1063,
1065,
1025,
9530,
3367,
17589,
1027,
1031,
1033,
1025,
2292,
5991,
1027,
1031,
1033,
1025,
9255,
1012,
18921,
6776,
1006,
3853,
1006,
6454,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
typeorm/typeorm | extra/typeorm-class-transformer-shim.js | ManyToMany | function ManyToMany(typeFunction, inverseSideOrOptions, options) {
return function (object, propertyName) {
class_transformer_1.Type(typeFunction)(object, propertyName);
};
} | javascript | function ManyToMany(typeFunction, inverseSideOrOptions, options) {
return function (object, propertyName) {
class_transformer_1.Type(typeFunction)(object, propertyName);
};
} | [
"function",
"ManyToMany",
"(",
"typeFunction",
",",
"inverseSideOrOptions",
",",
"options",
")",
"{",
"return",
"function",
"(",
"object",
",",
"propertyName",
")",
"{",
"class_transformer_1",
".",
"Type",
"(",
"typeFunction",
")",
"(",
"object",
",",
"propertyN... | /* export | [
"/",
"*",
"export"
] | 360468b7913db8d988346fba1ee2d3f323498eef | https://github.com/typeorm/typeorm/blob/360468b7913db8d988346fba1ee2d3f323498eef/extra/typeorm-class-transformer-shim.js#L140-L144 | train | Creates a function that takes a typeFunction and returns a function that takes an object and a property name and returns a function that takes an inverse side or options object and returns a function that takes an inverse side or options object and returns a function that takes an inverse side or options object. | [
30522,
3853,
2116,
20389,
19092,
1006,
2828,
11263,
27989,
1010,
19262,
7363,
14604,
16790,
2015,
1010,
7047,
1007,
1063,
2709,
3853,
1006,
4874,
1010,
3200,
18442,
1007,
1063,
2465,
1035,
10938,
2121,
1035,
1015,
1012,
2828,
1006,
2828,
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... |
dequelabs/axe-core | lib/core/utils/merge-results.js | spliceNodes | function spliceNodes(target, to) {
'use strict';
var firstFromFrame = to[0].node,
sorterResult,
t;
for (var i = 0, l = target.length; i < l; i++) {
t = target[i].node;
sorterResult = axe.utils.nodeSorter(
{ actualNode: t.element },
{ actualNode: firstFromFrame.element }
);
if (
sorterResult > 0... | javascript | function spliceNodes(target, to) {
'use strict';
var firstFromFrame = to[0].node,
sorterResult,
t;
for (var i = 0, l = target.length; i < l; i++) {
t = target[i].node;
sorterResult = axe.utils.nodeSorter(
{ actualNode: t.element },
{ actualNode: firstFromFrame.element }
);
if (
sorterResult > 0... | [
"function",
"spliceNodes",
"(",
"target",
",",
"to",
")",
"{",
"'use strict'",
";",
"var",
"firstFromFrame",
"=",
"to",
"[",
"0",
"]",
".",
"node",
",",
"sorterResult",
",",
"t",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"l",
"=",
"target",
".",
... | Adds `to` to `from` and then re-sorts by DOM order
@private
@param {Array} target `nodes` array on a `RuleResult`
@param {Array} to `nodes` array on a `RuleResult`
@return {Array} The merged and sorted result | [
"Adds",
"to",
"to",
"from",
"and",
"then",
"re",
"-",
"sorts",
"by",
"DOM",
"order"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/utils/merge-results.js#L38-L60 | train | Splice nodes from target to to | [
30522,
3853,
11867,
13231,
3630,
6155,
1006,
4539,
1010,
2000,
1007,
1063,
1005,
2224,
9384,
1005,
1025,
13075,
2034,
19699,
5358,
15643,
1027,
2000,
1031,
1014,
1033,
1012,
13045,
1010,
4066,
28849,
23722,
2102,
1010,
1056,
1025,
2005,
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... |
keplergl/kepler.gl | examples/demo-app/src/actions.js | loadRemoteSampleMap | function loadRemoteSampleMap(options) {
return (dispatch) => {
// Load configuration first
const {configUrl, dataUrl} = options;
Promise
.all([loadRemoteConfig(configUrl), loadRemoteData(dataUrl)])
.then(
([config, data]) => {
// TODO: these two actions can be merged
... | javascript | function loadRemoteSampleMap(options) {
return (dispatch) => {
// Load configuration first
const {configUrl, dataUrl} = options;
Promise
.all([loadRemoteConfig(configUrl), loadRemoteData(dataUrl)])
.then(
([config, data]) => {
// TODO: these two actions can be merged
... | [
"function",
"loadRemoteSampleMap",
"(",
"options",
")",
"{",
"return",
"(",
"dispatch",
")",
"=>",
"{",
"// Load configuration first",
"const",
"{",
"configUrl",
",",
"dataUrl",
"}",
"=",
"options",
";",
"Promise",
".",
"all",
"(",
"[",
"loadRemoteConfig",
"("... | Load remote map with config and data
@param options {configUrl, dataUrl}
@returns {Function} | [
"Load",
"remote",
"map",
"with",
"config",
"and",
"data"
] | 779238435707cc54335c2d00001e4b9334b314aa | https://github.com/keplergl/kepler.gl/blob/779238435707cc54335c2d00001e4b9334b314aa/examples/demo-app/src/actions.js#L223-L245 | train | Load remote sample map | [
30522,
3853,
7170,
28578,
12184,
21559,
10814,
2863,
2361,
1006,
7047,
1007,
1063,
2709,
1006,
18365,
1007,
1027,
1028,
1063,
1013,
1013,
7170,
9563,
2034,
9530,
3367,
1063,
9530,
8873,
27390,
2140,
1010,
2951,
3126,
2140,
1065,
1027,
7047,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/NavigationAndHistory/main.js | _onClick | function _onClick(event) {
var $scope = $(event.delegateTarget).parent();
_openEditorForContext({
path: $scope.data("path"),
paneId: $scope.data("paneId"),
cursor: $scope.data("cursor"),
hideOnOpenFile: true
});
... | javascript | function _onClick(event) {
var $scope = $(event.delegateTarget).parent();
_openEditorForContext({
path: $scope.data("path"),
paneId: $scope.data("paneId"),
cursor: $scope.data("cursor"),
hideOnOpenFile: true
});
... | [
"function",
"_onClick",
"(",
"event",
")",
"{",
"var",
"$scope",
"=",
"$",
"(",
"event",
".",
"delegateTarget",
")",
".",
"parent",
"(",
")",
";",
"_openEditorForContext",
"(",
"{",
"path",
":",
"$scope",
".",
"data",
"(",
"\"path\"",
")",
",",
"paneId... | Click handler for the link in list item
@private | [
"Click",
"handler",
"for",
"the",
"link",
"in",
"list",
"item"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/main.js#L427-L435 | train | Click event handler for the neccessary menu item | [
30522,
3853,
1035,
2006,
20464,
6799,
1006,
2724,
1007,
1063,
13075,
1002,
9531,
1027,
1002,
1006,
2724,
1012,
11849,
7559,
18150,
1007,
1012,
6687,
1006,
1007,
1025,
1035,
2441,
15660,
29278,
8663,
18209,
1006,
1063,
4130,
1024,
1002,
9531... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
markdown-it/markdown-it | lib/rules_core/smartquotes.js | replaceAt | function replaceAt(str, index, ch) {
return str.substr(0, index) + ch + str.substr(index + 1);
} | javascript | function replaceAt(str, index, ch) {
return str.substr(0, index) + ch + str.substr(index + 1);
} | [
"function",
"replaceAt",
"(",
"str",
",",
"index",
",",
"ch",
")",
"{",
"return",
"str",
".",
"substr",
"(",
"0",
",",
"index",
")",
"+",
"ch",
"+",
"str",
".",
"substr",
"(",
"index",
"+",
"1",
")",
";",
"}"
] | /* ’ | [
"/",
"*",
"’"
] | ba6830ba13fb92953a91fb90318964ccd15b82c4 | https://github.com/markdown-it/markdown-it/blob/ba6830ba13fb92953a91fb90318964ccd15b82c4/lib/rules_core/smartquotes.js#L15-L17 | train | Replace a character at a given index in a string | [
30522,
3853,
5672,
4017,
1006,
2358,
2099,
1010,
5950,
1010,
10381,
1007,
1063,
2709,
2358,
2099,
1012,
4942,
3367,
2099,
1006,
1014,
1010,
5950,
1007,
1009,
10381,
1009,
2358,
2099,
1012,
4942,
3367,
2099,
1006,
5950,
1009,
1015,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
facebook/relay | packages/relay-compiler/language/javascript/RelayFlowBabelFactories.js | anyTypeAlias | function anyTypeAlias(name: string): BabelAST {
return t.typeAlias(t.identifier(name), null, t.anyTypeAnnotation());
} | javascript | function anyTypeAlias(name: string): BabelAST {
return t.typeAlias(t.identifier(name), null, t.anyTypeAnnotation());
} | [
"function",
"anyTypeAlias",
"(",
"name",
":",
"string",
")",
":",
"BabelAST",
"{",
"return",
"t",
".",
"typeAlias",
"(",
"t",
".",
"identifier",
"(",
"name",
")",
",",
"null",
",",
"t",
".",
"anyTypeAnnotation",
"(",
")",
")",
";",
"}"
] | type NAME = any; | [
"type",
"NAME",
"=",
"any",
";"
] | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-compiler/language/javascript/RelayFlowBabelFactories.js#L21-L23 | train | A type alias for any type | [
30522,
3853,
2151,
13874,
22786,
2015,
1006,
2171,
1024,
5164,
1007,
1024,
11561,
8523,
2102,
1063,
2709,
1056,
1012,
2828,
22786,
2015,
1006,
1056,
1012,
8909,
4765,
18095,
1006,
2171,
1007,
1010,
19701,
1010,
1056,
1012,
2151,
13874,
1163... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/less.js | function (color1, color2, weight) {
if (!weight) {
weight = new(tree.Dimension)(50);
}
var p = weight.value / 100.0;
var w = p * 2 - 1;
var a = color1.toHSL().a - color2.toHSL().a;
var w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
var ... | javascript | function (color1, color2, weight) {
if (!weight) {
weight = new(tree.Dimension)(50);
}
var p = weight.value / 100.0;
var w = p * 2 - 1;
var a = color1.toHSL().a - color2.toHSL().a;
var w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
var ... | [
"function",
"(",
"color1",
",",
"color2",
",",
"weight",
")",
"{",
"if",
"(",
"!",
"weight",
")",
"{",
"weight",
"=",
"new",
"(",
"tree",
".",
"Dimension",
")",
"(",
"50",
")",
";",
"}",
"var",
"p",
"=",
"weight",
".",
"value",
"/",
"100.0",
";... | Copyright (c) 2006-2009 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein http://sass-lang.com | [
"Copyright",
"(",
"c",
")",
"2006",
"-",
"2009",
"Hampton",
"Catlin",
"Nathan",
"Weizenbaum",
"and",
"Chris",
"Eppstein",
"http",
":",
"//",
"sass",
"-",
"lang",
".",
"com"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/less.js#L2173-L2191 | train | Returns a new color | [
30522,
3853,
1006,
3609,
2487,
1010,
3609,
2475,
1010,
3635,
1007,
1063,
2065,
1006,
999,
3635,
1007,
1063,
3635,
1027,
2047,
1006,
3392,
30524,
1059,
1027,
1052,
1008,
1016,
1011,
1015,
1025,
13075,
1037,
1027,
3609,
2487,
1012,
2000,
78... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
openlayers/openlayers | examples/raster.js | vgi | function vgi(pixel) {
const r = pixel[0] / 255;
const g = pixel[1] / 255;
const b = pixel[2] / 255;
return (2 * g - r - b) / (2 * g + r + b);
} | javascript | function vgi(pixel) {
const r = pixel[0] / 255;
const g = pixel[1] / 255;
const b = pixel[2] / 255;
return (2 * g - r - b) / (2 * g + r + b);
} | [
"function",
"vgi",
"(",
"pixel",
")",
"{",
"const",
"r",
"=",
"pixel",
"[",
"0",
"]",
"/",
"255",
";",
"const",
"g",
"=",
"pixel",
"[",
"1",
"]",
"/",
"255",
";",
"const",
"b",
"=",
"pixel",
"[",
"2",
"]",
"/",
"255",
";",
"return",
"(",
"2... | Calculate the Vegetation Greenness Index (VGI) from an input pixel. This
is a rough estimate assuming that pixel values correspond to reflectance.
@param {Array<number>} pixel An array of [R, G, B, A] values.
@return {number} The VGI value for the given pixel. | [
"Calculate",
"the",
"Vegetation",
"Greenness",
"Index",
"(",
"VGI",
")",
"from",
"an",
"input",
"pixel",
".",
"This",
"is",
"a",
"rough",
"estimate",
"assuming",
"that",
"pixel",
"values",
"correspond",
"to",
"reflectance",
"."
] | f366eaea522388fb575b11010e69d309164baca7 | https://github.com/openlayers/openlayers/blob/f366eaea522388fb575b11010e69d309164baca7/examples/raster.js#L18-L23 | train | Calculate the vgi color | [
30522,
3853,
1058,
5856,
1006,
22138,
1007,
1063,
9530,
3367,
1054,
1027,
22138,
1031,
1014,
1033,
1013,
20637,
1025,
9530,
3367,
1043,
1027,
22138,
1031,
1015,
1033,
1013,
20637,
1025,
9530,
3367,
1038,
1027,
22138,
1031,
1016,
1033,
1013,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Freeboard/freeboard | js/freeboard.thirdparty.js | Draggable | function Draggable(el, options)
{
this.options = $.extend({}, defaults, options);
this.$body = $(document.body);
this.$container = $(el);
this.$dragitems = $(this.options.items, this.$container);
this.is_dragging = false;
this.player_min_left = 0 + this.options.offset_left;
this.init();
} | javascript | function Draggable(el, options)
{
this.options = $.extend({}, defaults, options);
this.$body = $(document.body);
this.$container = $(el);
this.$dragitems = $(this.options.items, this.$container);
this.is_dragging = false;
this.player_min_left = 0 + this.options.offset_left;
this.init();
} | [
"function",
"Draggable",
"(",
"el",
",",
"options",
")",
"{",
"this",
".",
"options",
"=",
"$",
".",
"extend",
"(",
"{",
"}",
",",
"defaults",
",",
"options",
")",
";",
"this",
".",
"$body",
"=",
"$",
"(",
"document",
".",
"body",
")",
";",
"this... | Basic drag implementation for DOM elements inside a container.
Provide start/stop/drag callbacks.
@class Draggable
@param {HTMLElement} el The HTMLelement that contains all the panes
to be dragged.
@param {Object} [options] An Object with all options you want to
overwrite:
@param {HTMLElement|String} [options.items] D... | [
"Basic",
"drag",
"implementation",
"for",
"DOM",
"elements",
"inside",
"a",
"container",
".",
"Provide",
"start",
"/",
"stop",
"/",
"drag",
"callbacks",
"."
] | 38789f6e8bd3d04f7d3b2c3427e509d00f2610fc | https://github.com/Freeboard/freeboard/blob/38789f6e8bd3d04f7d3b2c3427e509d00f2610fc/js/freeboard.thirdparty.js#L15597-L15606 | train | Draggable constructor. | [
30522,
3853,
8011,
3654,
3468,
1006,
3449,
1010,
7047,
1007,
1063,
2023,
1012,
7047,
1027,
1002,
1012,
7949,
1006,
1063,
1065,
1010,
12398,
2015,
1010,
7047,
1007,
1025,
2023,
1012,
1002,
2303,
1027,
1002,
1006,
6254,
1012,
2303,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/LiveDevelopment/MultiBrowserImpl/documents/LiveCSSDocument.js | makeUrlsRelativeToCss | function makeUrlsRelativeToCss(match, quotationMark, url) {
if (PathUtils.isRelativeUrl(url)) {
var absUrl = PathUtils.makeUrlAbsolute(url, docUrl);
return "url(" + quotationMark + absUrl + quotationMark + ")";
}
return match;
} | javascript | function makeUrlsRelativeToCss(match, quotationMark, url) {
if (PathUtils.isRelativeUrl(url)) {
var absUrl = PathUtils.makeUrlAbsolute(url, docUrl);
return "url(" + quotationMark + absUrl + quotationMark + ")";
}
return match;
} | [
"function",
"makeUrlsRelativeToCss",
"(",
"match",
",",
"quotationMark",
",",
"url",
")",
"{",
"if",
"(",
"PathUtils",
".",
"isRelativeUrl",
"(",
"url",
")",
")",
"{",
"var",
"absUrl",
"=",
"PathUtils",
".",
"makeUrlAbsolute",
"(",
"url",
",",
"docUrl",
")... | Determines whether an url() line contains a relative or absolute URL, and makes the URL absolute to the CSS file if it is relative | [
"Determines",
"whether",
"an",
"url",
"()",
"line",
"contains",
"a",
"relative",
"or",
"absolute",
"URL",
"and",
"makes",
"the",
"URL",
"absolute",
"to",
"the",
"CSS",
"file",
"if",
"it",
"is",
"relative"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/documents/LiveCSSDocument.js#L104-L110 | train | makeUrlsRelativeToCss - make urls relative to css | [
30522,
3853,
2191,
3126,
4877,
16570,
8082,
3406,
6169,
2015,
1006,
2674,
1010,
20563,
3508,
10665,
1010,
24471,
2140,
1007,
1063,
2065,
1006,
4130,
21823,
4877,
1012,
2003,
16570,
8082,
3126,
2140,
1006,
24471,
2140,
1007,
1007,
1063,
1307... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/security/URLWhitelist.js | URLWhitelistEntry | function URLWhitelistEntry(protocol, host, port, path){
if (protocol) {
this.protocol = protocol.toUpperCase();
}
if (host) {
this.host = host.toUpperCase();
}
this.port = port;
this.path = path;
} | javascript | function URLWhitelistEntry(protocol, host, port, path){
if (protocol) {
this.protocol = protocol.toUpperCase();
}
if (host) {
this.host = host.toUpperCase();
}
this.port = port;
this.path = path;
} | [
"function",
"URLWhitelistEntry",
"(",
"protocol",
",",
"host",
",",
"port",
",",
"path",
")",
"{",
"if",
"(",
"protocol",
")",
"{",
"this",
".",
"protocol",
"=",
"protocol",
".",
"toUpperCase",
"(",
")",
";",
"}",
"if",
"(",
"host",
")",
"{",
"this",... | Entry object of the URLWhitelist
@public
@typedef {object} module:sap/base/security/URLWhitelist.Entry
@property {string} protocol The protocol of the URL
@property {string} host The host of the URL
@property {string} port The port of the URL
@property {string} path the path of the URL | [
"Entry",
"object",
"of",
"the",
"URLWhitelist"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/base/security/URLWhitelist.js#L28-L37 | train | URLWhitelistEntry constructor | [
30522,
3853,
24471,
2140,
2860,
16584,
29282,
6528,
11129,
1006,
8778,
1010,
3677,
1010,
3417,
1010,
4130,
1007,
1063,
2065,
1006,
8778,
1007,
1063,
2023,
1012,
8778,
1027,
8778,
1012,
2000,
29547,
18992,
3366,
1006,
1007,
1025,
1065,
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... |
eslint/eslint | lib/rules/keyword-spacing.js | checkSpacingForForOfStatement | function checkSpacingForForOfStatement(node) {
if (node.await) {
checkSpacingBefore(sourceCode.getFirstToken(node, 0));
checkSpacingAfter(sourceCode.getFirstToken(node, 1));
} else {
checkSpacingAroundFirstToken(node);
}
che... | javascript | function checkSpacingForForOfStatement(node) {
if (node.await) {
checkSpacingBefore(sourceCode.getFirstToken(node, 0));
checkSpacingAfter(sourceCode.getFirstToken(node, 1));
} else {
checkSpacingAroundFirstToken(node);
}
che... | [
"function",
"checkSpacingForForOfStatement",
"(",
"node",
")",
"{",
"if",
"(",
"node",
".",
"await",
")",
"{",
"checkSpacingBefore",
"(",
"sourceCode",
".",
"getFirstToken",
"(",
"node",
",",
"0",
")",
")",
";",
"checkSpacingAfter",
"(",
"sourceCode",
".",
"... | Reports `for` and `of` keywords of a given node if usage of spacing
around those keywords is invalid.
@param {ASTNode} node - A node to report.
@returns {void} | [
"Reports",
"for",
"and",
"of",
"keywords",
"of",
"a",
"given",
"node",
"if",
"usage",
"of",
"spacing",
"around",
"those",
"keywords",
"is",
"invalid",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/keyword-spacing.js#L434-L442 | train | Check spacing around for of statement | [
30522,
3853,
14148,
19498,
2075,
29278,
29278,
11253,
9153,
18532,
4765,
1006,
13045,
1007,
1063,
2065,
1006,
13045,
1012,
26751,
1007,
1063,
14148,
19498,
2075,
4783,
29278,
2063,
1006,
3120,
16044,
1012,
2131,
8873,
12096,
18715,
2368,
1006... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
parcel-bundler/parcel | packages/core/parcel-bundler/src/transforms/babel/babelrc.js | getBabelRc | async function getBabelRc(asset, isSource) {
// Support legacy browserify packages
let pkg = await asset.getPackage();
let browserify = pkg && pkg.browserify;
if (browserify && Array.isArray(browserify.transform)) {
// Look for babelify in the browserify transform list
let babelify = browserify.transfor... | javascript | async function getBabelRc(asset, isSource) {
// Support legacy browserify packages
let pkg = await asset.getPackage();
let browserify = pkg && pkg.browserify;
if (browserify && Array.isArray(browserify.transform)) {
// Look for babelify in the browserify transform list
let babelify = browserify.transfor... | [
"async",
"function",
"getBabelRc",
"(",
"asset",
",",
"isSource",
")",
"{",
"// Support legacy browserify packages",
"let",
"pkg",
"=",
"await",
"asset",
".",
"getPackage",
"(",
")",
";",
"let",
"browserify",
"=",
"pkg",
"&&",
"pkg",
".",
"browserify",
";",
... | Finds a .babelrc for an asset. By default, .babelrc files inside node_modules are not used.
However, there are some exceptions:
- if `browserify.transforms` includes "babelify" in package.json (for legacy module compat)
- the `source` field in package.json is used by the resolver | [
"Finds",
"a",
".",
"babelrc",
"for",
"an",
"asset",
".",
"By",
"default",
".",
"babelrc",
"files",
"inside",
"node_modules",
"are",
"not",
"used",
".",
"However",
"there",
"are",
"some",
"exceptions",
":",
"-",
"if",
"browserify",
".",
"transforms",
"inclu... | 84b308511f87d4b69da62bcd352f0ff2f7bd4f1b | https://github.com/parcel-bundler/parcel/blob/84b308511f87d4b69da62bcd352f0ff2f7bd4f1b/packages/core/parcel-bundler/src/transforms/babel/babelrc.js#L40-L67 | train | Get the. babelrc from the asset | [
30522,
2004,
6038,
2278,
3853,
2131,
3676,
8671,
11890,
1006,
11412,
1010,
26354,
8162,
3401,
1007,
1063,
1013,
1013,
2490,
8027,
16602,
8757,
14555,
2292,
1052,
2243,
2290,
1027,
26751,
11412,
1012,
2131,
23947,
4270,
1006,
1007,
1025,
229... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
transloadit/uppy | website/themes/uppy/source/js/common.js | updateSidebar | function updateSidebar () {
var top = (doc && doc.scrollTop) || body.scrollTop
var headerHeight = header.offsetHeight
if (top > (headerHeight - 25)) {
// main.classList.add('fix-sidebar')
header.classList.add('fix-header')
} else {
// main.classList.remove('fix-sidebar')
... | javascript | function updateSidebar () {
var top = (doc && doc.scrollTop) || body.scrollTop
var headerHeight = header.offsetHeight
if (top > (headerHeight - 25)) {
// main.classList.add('fix-sidebar')
header.classList.add('fix-header')
} else {
// main.classList.remove('fix-sidebar')
... | [
"function",
"updateSidebar",
"(",
")",
"{",
"var",
"top",
"=",
"(",
"doc",
"&&",
"doc",
".",
"scrollTop",
")",
"||",
"body",
".",
"scrollTop",
"var",
"headerHeight",
"=",
"header",
".",
"offsetHeight",
"if",
"(",
"top",
">",
"(",
"headerHeight",
"-",
"... | // listen for scroll event to do positioning & highlights window.addEventListener('scroll', updateSidebar) window.addEventListener('resize', updateSidebar) | [
"//",
"listen",
"for",
"scroll",
"event",
"to",
"do",
"positioning",
"&",
"highlights",
"window",
".",
"addEventListener",
"(",
"scroll",
"updateSidebar",
")",
"window",
".",
"addEventListener",
"(",
"resize",
"updateSidebar",
")"
] | 7ae18bf992d544a64da998f033258ec09a3de275 | https://github.com/transloadit/uppy/blob/7ae18bf992d544a64da998f033258ec09a3de275/website/themes/uppy/source/js/common.js#L30-L54 | train | Update sidebar | [
30522,
3853,
14409,
5178,
8237,
1006,
1007,
1063,
13075,
2327,
1027,
1006,
9986,
1004,
1004,
9986,
1012,
17186,
14399,
1007,
1064,
1064,
2303,
1012,
17186,
14399,
13075,
20346,
26036,
13900,
1027,
20346,
1012,
16396,
26036,
13900,
2065,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js | templateIf | function templateIf(oIfElement, oWithControl) {
iNestingLevel++;
return stopAndGo(getIfChildren(oIfElement) || [oIfElement], function (oCandidate) {
if (oCandidate.localName === "else") {
return oSyncPromiseResolvedTrue;
}
if (oCandidate.localName === "then") {
oCandidate = oIfElement... | javascript | function templateIf(oIfElement, oWithControl) {
iNestingLevel++;
return stopAndGo(getIfChildren(oIfElement) || [oIfElement], function (oCandidate) {
if (oCandidate.localName === "else") {
return oSyncPromiseResolvedTrue;
}
if (oCandidate.localName === "then") {
oCandidate = oIfElement... | [
"function",
"templateIf",
"(",
"oIfElement",
",",
"oWithControl",
")",
"{",
"iNestingLevel",
"++",
";",
"return",
"stopAndGo",
"(",
"getIfChildren",
"(",
"oIfElement",
")",
"||",
"[",
"oIfElement",
"]",
",",
"function",
"(",
"oCandidate",
")",
"{",
"if",
"("... | Processes a <template:if> instruction.
@param {Element} oIfElement
the <template:if> XML DOM element
@param {sap.ui.core.util._with} oWithControl
the "with" control
@returns {sap.ui.base.SyncPromise}
A sync promise which resolves with <code>undefined</code> as soon as the
<template:if> instruction has been fully proce... | [
"Processes",
"a",
"<template",
":",
"if",
">",
"instruction",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js#L1499-L1520 | train | templateIf - If - If - Else - If - Else - If - Else - If - Else - If - Else - If - Else - If - Else - If - Else - If - Else - If - Else - If - Else If - Else If - Else If - Else If - Else If - Else If - Else If - Else If - Else If - Else If - Else If - Else If - Else If - Else If - Else If - | [
30522,
3853,
23561,
10128,
1006,
1051,
29323,
16930,
4765,
1010,
27593,
8939,
8663,
13181,
2140,
1007,
1063,
1999,
4355,
2075,
20414,
2884,
1009,
1009,
1025,
2709,
2644,
5685,
3995,
1006,
2131,
10128,
19339,
7389,
1006,
1051,
29323,
16930,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dequelabs/axe-core | lib/commons/color/get-background-color.js | calculateObscuringAlpha | function calculateObscuringAlpha(elmIndex, elmStack, originalElm) {
var totalAlpha = 0;
if (elmIndex > 0) {
// there are elements above our element, check if they contribute to the background
for (var i = elmIndex - 1; i >= 0; i--) {
let bgElm = elmStack[i];
let bgElmStyle = window.getComputedStyle(bgElm);... | javascript | function calculateObscuringAlpha(elmIndex, elmStack, originalElm) {
var totalAlpha = 0;
if (elmIndex > 0) {
// there are elements above our element, check if they contribute to the background
for (var i = elmIndex - 1; i >= 0; i--) {
let bgElm = elmStack[i];
let bgElmStyle = window.getComputedStyle(bgElm);... | [
"function",
"calculateObscuringAlpha",
"(",
"elmIndex",
",",
"elmStack",
",",
"originalElm",
")",
"{",
"var",
"totalAlpha",
"=",
"0",
";",
"if",
"(",
"elmIndex",
">",
"0",
")",
"{",
"// there are elements above our element, check if they contribute to the background",
"... | Calculate alpha transparency of a background element obscuring the current node
@private
@param {Number} elmIndex
@param {Array} elmStack
@param {Element} originalElm
@return {Number|undefined} | [
"Calculate",
"alpha",
"transparency",
"of",
"a",
"background",
"element",
"obscuring",
"the",
"current",
"node"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/commons/color/get-background-color.js#L311-L329 | train | Calculate the alpha value of an element | [
30522,
3853,
18422,
16429,
28817,
4892,
2389,
21890,
1006,
17709,
22254,
10288,
1010,
17709,
9153,
3600,
1010,
2434,
2884,
2213,
1007,
1063,
13075,
2561,
2389,
21890,
1027,
1014,
1025,
2065,
1006,
17709,
22254,
10288,
1028,
1014,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.