repo stringclasses 195
values | path stringlengths 4 99 | func_name stringlengths 0 41 | original_string stringlengths 72 56.1k | language stringclasses 1
value | code stringlengths 72 56.1k | code_tokens listlengths 25 8.12k | docstring stringlengths 2 12.5k | docstring_tokens listlengths 1 449 | sha stringclasses 197
values | url stringlengths 88 186 | partition stringclasses 1
value | summary stringlengths 8 338 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
facebook/relay | packages/relay-compiler/core/GraphQLSchemaUtils.js | mayImplement | function mayImplement(
schema: GraphQLSchema,
type: GraphQLType,
typeName: string,
): boolean {
const unmodifiedType = getRawType(type);
return (
unmodifiedType.toString() === typeName ||
implementsInterface(unmodifiedType, typeName) ||
(isAbstractType(unmodifiedType) &&
hasConcreteTypeThatI... | javascript | function mayImplement(
schema: GraphQLSchema,
type: GraphQLType,
typeName: string,
): boolean {
const unmodifiedType = getRawType(type);
return (
unmodifiedType.toString() === typeName ||
implementsInterface(unmodifiedType, typeName) ||
(isAbstractType(unmodifiedType) &&
hasConcreteTypeThatI... | [
"function",
"mayImplement",
"(",
"schema",
":",
"GraphQLSchema",
",",
"type",
":",
"GraphQLType",
",",
"typeName",
":",
"string",
",",
")",
":",
"boolean",
"{",
"const",
"unmodifiedType",
"=",
"getRawType",
"(",
"type",
")",
";",
"return",
"(",
"unmodifiedTy... | Determine if the given type may implement the named type:
- it is the named type
- it implements the named interface
- it is an abstract type and *some* of its concrete types may
implement the named type | [
"Determine",
"if",
"the",
"given",
"type",
"may",
"implement",
"the",
"named",
"type",
":",
"-",
"it",
"is",
"the",
"named",
"type",
"-",
"it",
"implements",
"the",
"named",
"interface",
"-",
"it",
"is",
"an",
"abstract",
"type",
"and",
"*",
"some",
"*... | 7fb9be5182b9650637d7b92ead9a42713ac30aa4 | https://github.com/facebook/relay/blob/7fb9be5182b9650637d7b92ead9a42713ac30aa4/packages/relay-compiler/core/GraphQLSchemaUtils.js#L62-L74 | train | Returns true if the given type implements the given type | [
30522,
3853,
2089,
30524,
5403,
2863,
1010,
2828,
1024,
10629,
4160,
24228,
5051,
1010,
2828,
18442,
1024,
5164,
1010,
1007,
1024,
22017,
20898,
1063,
9530,
3367,
4895,
5302,
4305,
10451,
13874,
1027,
2131,
2527,
26677,
18863,
1006,
2828,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SheetJS/js-xlsx | xlsx.js | parse_BrtRowHdr | function parse_BrtRowHdr(data, length) {
var z = ({});
var tgt = data.l + length;
z.r = data.read_shift(4);
data.l += 4; // TODO: ixfe
var miyRw = data.read_shift(2);
data.l += 1; // TODO: top/bot padding
var flags = data.read_shift(1);
data.l = tgt;
if(flags & 0x07) z.level = flags & 0x07;
if(flags & 0x10) z... | javascript | function parse_BrtRowHdr(data, length) {
var z = ({});
var tgt = data.l + length;
z.r = data.read_shift(4);
data.l += 4; // TODO: ixfe
var miyRw = data.read_shift(2);
data.l += 1; // TODO: top/bot padding
var flags = data.read_shift(1);
data.l = tgt;
if(flags & 0x07) z.level = flags & 0x07;
if(flags & 0x10) z... | [
"function",
"parse_BrtRowHdr",
"(",
"data",
",",
"length",
")",
"{",
"var",
"z",
"=",
"(",
"{",
"}",
")",
";",
"var",
"tgt",
"=",
"data",
".",
"l",
"+",
"length",
";",
"z",
".",
"r",
"=",
"data",
".",
"read_shift",
"(",
"4",
")",
";",
"data",
... | /* [MS-XLSB] 2.4.726 BrtRowHdr | [
"/",
"*",
"[",
"MS",
"-",
"XLSB",
"]",
"2",
".",
"4",
".",
"726",
"BrtRowHdr"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L13385-L13398 | train | Parse a BrtRow header | [
30522,
3853,
11968,
3366,
1035,
7987,
13181,
2860,
14945,
2099,
1006,
2951,
1010,
3091,
1007,
1063,
13075,
1062,
1027,
1006,
1063,
1065,
1007,
1025,
13075,
1056,
13512,
1027,
2951,
1012,
1048,
1009,
3091,
1025,
1062,
1012,
1054,
1027,
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... |
SheetJS/js-xlsx | xlsx.js | parse_RString | function parse_RString(blob, length, opts) {
var end = blob.l + length;
var cell = parse_XLSCell(blob, 6);
var cch = blob.read_shift(2);
var str = parse_XLUnicodeStringNoCch(blob, cch, opts);
blob.l = end;
cell.t = 'str';
cell.val = str;
return cell;
} | javascript | function parse_RString(blob, length, opts) {
var end = blob.l + length;
var cell = parse_XLSCell(blob, 6);
var cch = blob.read_shift(2);
var str = parse_XLUnicodeStringNoCch(blob, cch, opts);
blob.l = end;
cell.t = 'str';
cell.val = str;
return cell;
} | [
"function",
"parse_RString",
"(",
"blob",
",",
"length",
",",
"opts",
")",
"{",
"var",
"end",
"=",
"blob",
".",
"l",
"+",
"length",
";",
"var",
"cell",
"=",
"parse_XLSCell",
"(",
"blob",
",",
"6",
")",
";",
"var",
"cch",
"=",
"blob",
".",
"read_shi... | /* TODO: parse rich text runs | [
"/",
"*",
"TODO",
":",
"parse",
"rich",
"text",
"runs"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L6617-L6626 | train | ECMA - 262 12. 2. 2 String | [
30522,
3853,
11968,
3366,
1035,
12667,
18886,
3070,
1006,
1038,
4135,
2497,
1010,
3091,
1010,
23569,
2015,
1007,
1063,
13075,
2203,
1027,
1038,
4135,
2497,
1012,
1048,
1009,
3091,
1025,
13075,
3526,
1027,
11968,
3366,
1035,
28712,
11020,
53... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GoogleChrome/workbox | packages/workbox-build/src/entry-points/generate-sw.js | generateSW | async function generateSW(config) {
// This check needs to be done before validation, since the deprecated options
// will be renamed.
const deprecationWarnings = checkForDeprecatedOptions(config);
const options = validate(config, generateSWSchema);
const destDirectory = path.dirname(options.swDest);
// ... | javascript | async function generateSW(config) {
// This check needs to be done before validation, since the deprecated options
// will be renamed.
const deprecationWarnings = checkForDeprecatedOptions(config);
const options = validate(config, generateSWSchema);
const destDirectory = path.dirname(options.swDest);
// ... | [
"async",
"function",
"generateSW",
"(",
"config",
")",
"{",
"// This check needs to be done before validation, since the deprecated options",
"// will be renamed.",
"const",
"deprecationWarnings",
"=",
"checkForDeprecatedOptions",
"(",
"config",
")",
";",
"const",
"options",
"=... | This method creates a list of URLs to precache, referred to as a "precache
manifest", based on the options you provide.
It also takes in additional options that configures the service worker's
behavior, like any `runtimeCaching` rules it should use.
Based on the precache manifest and the additional configuration, it ... | [
"This",
"method",
"creates",
"a",
"list",
"of",
"URLs",
"to",
"precache",
"referred",
"to",
"as",
"a",
"precache",
"manifest",
"based",
"on",
"the",
"options",
"you",
"provide",
"."
] | 8379c51b6deaf52faed5879206fe84579cae41f0 | https://github.com/GoogleChrome/workbox/blob/8379c51b6deaf52faed5879206fe84579cae41f0/packages/workbox-build/src/entry-points/generate-sw.js#L42-L83 | train | Generates a service worker using the given configuration. | [
30522,
2004,
6038,
2278,
3853,
19421,
2860,
1006,
9530,
8873,
2290,
1007,
1063,
1013,
1013,
2023,
4638,
3791,
2000,
2022,
2589,
2077,
27354,
1010,
2144,
1996,
2139,
28139,
12921,
7047,
1013,
1013,
2097,
2022,
4096,
1012,
9530,
3367,
2139,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
chartjs/Chart.js | src/scales/scale.time.js | determineUnitForAutoTicks | function determineUnitForAutoTicks(minUnit, min, max, capacity) {
var ilen = UNITS.length;
var i, interval, factor;
for (i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {
interval = INTERVALS[UNITS[i]];
factor = interval.steps ? interval.steps[interval.steps.length - 1] : MAX_INTEGER;
if (interval.common && M... | javascript | function determineUnitForAutoTicks(minUnit, min, max, capacity) {
var ilen = UNITS.length;
var i, interval, factor;
for (i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {
interval = INTERVALS[UNITS[i]];
factor = interval.steps ? interval.steps[interval.steps.length - 1] : MAX_INTEGER;
if (interval.common && M... | [
"function",
"determineUnitForAutoTicks",
"(",
"minUnit",
",",
"min",
",",
"max",
",",
"capacity",
")",
"{",
"var",
"ilen",
"=",
"UNITS",
".",
"length",
";",
"var",
"i",
",",
"interval",
",",
"factor",
";",
"for",
"(",
"i",
"=",
"UNITS",
".",
"indexOf",... | Figures out what unit results in an appropriate number of auto-generated ticks | [
"Figures",
"out",
"what",
"unit",
"results",
"in",
"an",
"appropriate",
"number",
"of",
"auto",
"-",
"generated",
"ticks"
] | f093c36574d290330ed623e60fbd070421c730d5 | https://github.com/chartjs/Chart.js/blob/f093c36574d290330ed623e60fbd070421c730d5/src/scales/scale.time.js#L278-L292 | train | Determines the unit that should be used for auto tick | [
30522,
3853,
5646,
19496,
24475,
6525,
16161,
26348,
2015,
1006,
8117,
19496,
2102,
1010,
8117,
1010,
4098,
1010,
3977,
1007,
1063,
13075,
17869,
2078,
1027,
3197,
1012,
3091,
1025,
13075,
1045,
1010,
13483,
1010,
5387,
1025,
2005,
1006,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Microsoft/vscode | build/lib/git.js | getVersion | function getVersion(repo) {
const git = path.join(repo, '.git');
const headPath = path.join(git, 'HEAD');
let head;
try {
head = fs.readFileSync(headPath, 'utf8').trim();
}
catch (e) {
return undefined;
}
if (/^[0-9a-f]{40}$/i.test(head)) {
return head;
}
... | javascript | function getVersion(repo) {
const git = path.join(repo, '.git');
const headPath = path.join(git, 'HEAD');
let head;
try {
head = fs.readFileSync(headPath, 'utf8').trim();
}
catch (e) {
return undefined;
}
if (/^[0-9a-f]{40}$/i.test(head)) {
return head;
}
... | [
"function",
"getVersion",
"(",
"repo",
")",
"{",
"const",
"git",
"=",
"path",
".",
"join",
"(",
"repo",
",",
"'.git'",
")",
";",
"const",
"headPath",
"=",
"path",
".",
"join",
"(",
"git",
",",
"'HEAD'",
")",
";",
"let",
"head",
";",
"try",
"{",
"... | Returns the sha1 commit version of a repository or undefined in case of failure. | [
"Returns",
"the",
"sha1",
"commit",
"version",
"of",
"a",
"repository",
"or",
"undefined",
"in",
"case",
"of",
"failure",
"."
] | 693a13cd32c5be798051edc0cb43e1e39fc456d9 | https://github.com/Microsoft/vscode/blob/693a13cd32c5be798051edc0cb43e1e39fc456d9/build/lib/git.js#L12-L52 | train | Get the version of the current branch | [
30522,
3853,
2131,
27774,
1006,
16360,
2080,
1007,
1063,
9530,
3367,
21025,
2102,
1027,
4130,
1012,
3693,
1006,
16360,
2080,
1010,
1005,
1012,
21025,
2102,
1005,
1007,
1025,
9530,
3367,
2132,
15069,
1027,
4130,
1012,
3693,
1006,
21025,
2102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/chips/demoCustomInputs/script.js | createFilterFor | function createFilterFor(query) {
var lowercaseQuery = query.toLowerCase();
return function filterFn(vegetable) {
return (vegetable._lowername.indexOf(lowercaseQuery) === 0) ||
(vegetable._lowertype.indexOf(lowercaseQuery) === 0);
};
} | javascript | function createFilterFor(query) {
var lowercaseQuery = query.toLowerCase();
return function filterFn(vegetable) {
return (vegetable._lowername.indexOf(lowercaseQuery) === 0) ||
(vegetable._lowertype.indexOf(lowercaseQuery) === 0);
};
} | [
"function",
"createFilterFor",
"(",
"query",
")",
"{",
"var",
"lowercaseQuery",
"=",
"query",
".",
"toLowerCase",
"(",
")",
";",
"return",
"function",
"filterFn",
"(",
"vegetable",
")",
"{",
"return",
"(",
"vegetable",
".",
"_lowername",
".",
"indexOf",
"(",... | Create filter function for a query string | [
"Create",
"filter",
"function",
"for",
"a",
"query",
"string"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/chips/demoCustomInputs/script.js#L46-L54 | train | Create a filter function for a given query | [
30522,
3853,
3443,
8873,
21928,
29278,
1006,
23032,
1007,
1063,
13075,
2896,
18382,
4226,
2854,
1027,
23032,
1012,
2000,
27663,
18992,
3366,
1006,
1007,
1025,
2709,
3853,
11307,
2546,
2078,
1006,
15415,
1007,
1063,
2709,
1006,
15415,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/type/Decimal.js | validateDecimal | function validateDecimal(sValue, sName) {
if (sValue) {
if (sValue.match(rDecimal)) {
return sValue;
}
logWarning(sValue, sName);
}
} | javascript | function validateDecimal(sValue, sName) {
if (sValue) {
if (sValue.match(rDecimal)) {
return sValue;
}
logWarning(sValue, sName);
}
} | [
"function",
"validateDecimal",
"(",
"sValue",
",",
"sName",
")",
"{",
"if",
"(",
"sValue",
")",
"{",
"if",
"(",
"sValue",
".",
"match",
"(",
"rDecimal",
")",
")",
"{",
"return",
"sValue",
";",
"}",
"logWarning",
"(",
"sValue",
",",
"sName",
")",
";",... | /*
Validates whether the given value is a valid Edm.Decimal value.
@param {string} sValue
the constraint minimum or maximum value
@param {string} sName
name for logging
@returns {string}
the validated value or undefined | [
"/",
"*",
"Validates",
"whether",
"the",
"given",
"value",
"is",
"a",
"valid",
"Edm",
".",
"Decimal",
"value",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/type/Decimal.js#L110-L117 | train | Validates the given value for a decimal property. | [
30522,
3853,
9398,
4383,
8586,
9581,
2140,
1006,
17917,
2389,
5657,
1010,
1055,
18442,
1007,
1063,
2065,
1006,
17917,
2389,
5657,
1007,
1063,
2065,
1006,
17917,
2389,
5657,
1012,
2674,
1006,
16428,
8586,
9581,
2140,
1007,
1007,
1063,
2709,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
nhn/tui.editor | src/js/codemirror/markdown.js | getType | function getType(state) {
var styles = [];
if (state.formatting) {
styles.push(tokenTypes.formatting);
if (typeof state.formatting === "string") state.formatting = [state.formatting];
for (var i = 0; i < state.formatting.length; i++) {
styles.push(tokenTypes.formatting + "-" + state... | javascript | function getType(state) {
var styles = [];
if (state.formatting) {
styles.push(tokenTypes.formatting);
if (typeof state.formatting === "string") state.formatting = [state.formatting];
for (var i = 0; i < state.formatting.length; i++) {
styles.push(tokenTypes.formatting + "-" + state... | [
"function",
"getType",
"(",
"state",
")",
"{",
"var",
"styles",
"=",
"[",
"]",
";",
"if",
"(",
"state",
".",
"formatting",
")",
"{",
"styles",
".",
"push",
"(",
"tokenTypes",
".",
"formatting",
")",
";",
"if",
"(",
"typeof",
"state",
".",
"formatting... | Inline | [
"Inline"
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/codemirror/markdown.js#L318-L399 | train | Get the type of the given state | [
30522,
3853,
2131,
13874,
1006,
2110,
1007,
1063,
13075,
6782,
1027,
1031,
1033,
1025,
2065,
1006,
2110,
1012,
4289,
3436,
1007,
1063,
6782,
1012,
5245,
1006,
19204,
13874,
2015,
1012,
4289,
3436,
1007,
1025,
2065,
1006,
2828,
11253,
2110,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
firebase/firebase-js-sdk | scripts/docgen/generate-docs.js | generateNodeSource | async function generateNodeSource() {
const sourceText = await fs.readFile(sourceFile, 'utf8');
// Parse index.d.ts. A dummy filename is required but it doesn't create a
// file.
let typescriptSourceFile = typescript.createSourceFile(
'temp.d.ts',
sourceText,
typescript.ScriptTarget.ES2015,
/*s... | javascript | async function generateNodeSource() {
const sourceText = await fs.readFile(sourceFile, 'utf8');
// Parse index.d.ts. A dummy filename is required but it doesn't create a
// file.
let typescriptSourceFile = typescript.createSourceFile(
'temp.d.ts',
sourceText,
typescript.ScriptTarget.ES2015,
/*s... | [
"async",
"function",
"generateNodeSource",
"(",
")",
"{",
"const",
"sourceText",
"=",
"await",
"fs",
".",
"readFile",
"(",
"sourceFile",
",",
"'utf8'",
")",
";",
"// Parse index.d.ts. A dummy filename is required but it doesn't create a",
"// file.",
"let",
"typescriptSou... | Generate an temporary abridged version of index.d.ts used to create
Node docs. | [
"Generate",
"an",
"temporary",
"abridged",
"version",
"of",
"index",
".",
"d",
".",
"ts",
"used",
"to",
"create",
"Node",
"docs",
"."
] | 491598a499813dacc23724de5e237ec220cc560e | https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/scripts/docgen/generate-docs.js#L250-L293 | train | Generate a node source file | [
30522,
2004,
6038,
2278,
3853,
9699,
3630,
6155,
8162,
3401,
1006,
1007,
1063,
9530,
3367,
3120,
18209,
1027,
26751,
1042,
2015,
1012,
3191,
8873,
2571,
1006,
3120,
8873,
2571,
1010,
1005,
21183,
2546,
2620,
1005,
1007,
1025,
1013,
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... |
getinsomnia/insomnia | packages/insomnia-importers/src/importers/openapi3.js | prepareQueryParams | function prepareQueryParams(endpointSchema) {
const isSendInQuery = p => p.in === 'query';
const parameters = endpointSchema.parameters || [];
const queryParameters = parameters.filter(isSendInQuery);
return convertParameters(queryParameters);
} | javascript | function prepareQueryParams(endpointSchema) {
const isSendInQuery = p => p.in === 'query';
const parameters = endpointSchema.parameters || [];
const queryParameters = parameters.filter(isSendInQuery);
return convertParameters(queryParameters);
} | [
"function",
"prepareQueryParams",
"(",
"endpointSchema",
")",
"{",
"const",
"isSendInQuery",
"=",
"p",
"=>",
"p",
".",
"in",
"===",
"'query'",
";",
"const",
"parameters",
"=",
"endpointSchema",
".",
"parameters",
"||",
"[",
"]",
";",
"const",
"queryParameters"... | Imports insomnia definitions of query parameters.
@param {Object} endpointSchema - OpenAPI 3 endpoint schema
@returns {Object[]} array of parameters definitions | [
"Imports",
"insomnia",
"definitions",
"of",
"query",
"parameters",
"."
] | e24ce7f7b41246e700c4b9bdb6b34b6652ad589b | https://github.com/getinsomnia/insomnia/blob/e24ce7f7b41246e700c4b9bdb6b34b6652ad589b/packages/insomnia-importers/src/importers/openapi3.js#L196-L201 | train | Converts endpoint schema query parameters to query parameters | [
30522,
3853,
7374,
4226,
2854,
28689,
5244,
1006,
2203,
26521,
5403,
2863,
1007,
1063,
9530,
3367,
26354,
10497,
2378,
4226,
2854,
1027,
1052,
1027,
1028,
1052,
1012,
1999,
1027,
1027,
1027,
1005,
23032,
1005,
1025,
9530,
3367,
11709,
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/model/analytics/odata4analytics.js | function() {
if (this._aDimensionNames) {
return this._aDimensionNames;
}
this._aDimensionNames = [];
for ( var sName in this._oDimensionSet) {
this._aDimensionNames.push(this._oDimensionSet[sName].getName());
}
return this._aDimensionNames;
} | javascript | function() {
if (this._aDimensionNames) {
return this._aDimensionNames;
}
this._aDimensionNames = [];
for ( var sName in this._oDimensionSet) {
this._aDimensionNames.push(this._oDimensionSet[sName].getName());
}
return this._aDimensionNames;
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_aDimensionNames",
")",
"{",
"return",
"this",
".",
"_aDimensionNames",
";",
"}",
"this",
".",
"_aDimensionNames",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"sName",
"in",
"this",
".",
"_oDimensionSet",
... | Get the names of all dimensions included in the query result
@returns {string[]} List of all dimension names
@public
@function
@name sap.ui.model.analytics.odata4analytics.QueryResult#getAllDimensionNames | [
"Get",
"the",
"names",
"of",
"all",
"dimensions",
"included",
"in",
"the",
"query",
"result"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/analytics/odata4analytics.js#L1009-L1021 | train | Returns an array of dimension names | [
30522,
3853,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
1035,
27133,
3549,
10992,
18442,
2015,
1007,
1063,
2709,
2023,
1012,
1035,
27133,
3549,
10992,
18442,
2015,
1025,
1065,
2023,
1012,
1035,
27133,
3549,
10992,
18442,
2015,
1027,
1031,
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/Agents/RemoteFunctions.js | _validEvent | function _validEvent(event) {
if (window.navigator.platform.substr(0, 3) === "Mac") {
// Mac
return event.metaKey;
} else {
// Windows
return event.ctrlKey;
}
} | javascript | function _validEvent(event) {
if (window.navigator.platform.substr(0, 3) === "Mac") {
// Mac
return event.metaKey;
} else {
// Windows
return event.ctrlKey;
}
} | [
"function",
"_validEvent",
"(",
"event",
")",
"{",
"if",
"(",
"window",
".",
"navigator",
".",
"platform",
".",
"substr",
"(",
"0",
",",
"3",
")",
"===",
"\"Mac\"",
")",
"{",
"// Mac",
"return",
"event",
".",
"metaKey",
";",
"}",
"else",
"{",
"// Win... | Keep alive timeout value, in milliseconds determine whether an event should be processed for Live Development | [
"Keep",
"alive",
"timeout",
"value",
"in",
"milliseconds",
"determine",
"whether",
"an",
"event",
"should",
"be",
"processed",
"for",
"Live",
"Development"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/RemoteFunctions.js#L66-L74 | train | Check if the event is valid | [
30522,
3853,
1035,
9398,
18697,
3372,
1006,
2724,
1007,
1063,
2065,
1006,
3332,
1012,
20532,
1012,
4132,
1012,
4942,
3367,
2099,
1006,
1014,
1010,
1017,
1007,
1027,
1027,
1027,
1000,
6097,
1000,
1007,
1063,
1013,
1013,
6097,
2709,
2724,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.unified/src/sap/ui/unified/CalendarRow.js | _determineVisibleAppointments | function _determineVisibleAppointments() {
var aAppointments = this._getAppointmentsSorted();
var oAppointment;
var oGroupAppointment;
var oGroupAppointment2;
var iIntervals = this.getIntervals();
var sIntervalType = this.getIntervalType();
var oStartDate = this._getStartDate();
var iStartTime = oStart... | javascript | function _determineVisibleAppointments() {
var aAppointments = this._getAppointmentsSorted();
var oAppointment;
var oGroupAppointment;
var oGroupAppointment2;
var iIntervals = this.getIntervals();
var sIntervalType = this.getIntervalType();
var oStartDate = this._getStartDate();
var iStartTime = oStart... | [
"function",
"_determineVisibleAppointments",
"(",
")",
"{",
"var",
"aAppointments",
"=",
"this",
".",
"_getAppointmentsSorted",
"(",
")",
";",
"var",
"oAppointment",
";",
"var",
"oGroupAppointment",
";",
"var",
"oGroupAppointment2",
";",
"var",
"iIntervals",
"=",
... | /*
returns an array of visible appointments
each entry is an object with the following properties
- appointment: the appointment object
- begin: begin position in %
- end: end position in %
- level: level of the appointment to not overlap | [
"/",
"*",
"returns",
"an",
"array",
"of",
"visible",
"appointments",
"each",
"entry",
"is",
"an",
"object",
"with",
"the",
"following",
"properties",
"-",
"appointment",
":",
"the",
"appointment",
"object",
"-",
"begin",
":",
"begin",
"position",
"in",
"%",
... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.unified/src/sap/ui/unified/CalendarRow.js#L1092-L1262 | train | Determines if the calendar is visible. | [
30522,
3853,
1035,
5646,
11365,
7028,
29098,
25785,
8163,
1006,
1007,
1063,
13075,
9779,
9397,
25785,
8163,
1027,
2023,
1012,
1035,
2131,
29098,
25785,
8163,
21748,
3064,
1006,
1007,
1025,
13075,
1051,
29098,
25785,
3672,
1025,
13075,
13958,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mochajs/mocha | lib/reporters/list.js | List | function List(runner, options) {
Base.call(this, runner, options);
var self = this;
var n = 0;
runner.on(EVENT_RUN_BEGIN, function() {
console.log();
});
runner.on(EVENT_TEST_BEGIN, function(test) {
process.stdout.write(color('pass', ' ' + test.fullTitle() + ': '));
});
runner.on(EVENT_TE... | javascript | function List(runner, options) {
Base.call(this, runner, options);
var self = this;
var n = 0;
runner.on(EVENT_RUN_BEGIN, function() {
console.log();
});
runner.on(EVENT_TEST_BEGIN, function(test) {
process.stdout.write(color('pass', ' ' + test.fullTitle() + ': '));
});
runner.on(EVENT_TE... | [
"function",
"List",
"(",
"runner",
",",
"options",
")",
"{",
"Base",
".",
"call",
"(",
"this",
",",
"runner",
",",
"options",
")",
";",
"var",
"self",
"=",
"this",
";",
"var",
"n",
"=",
"0",
";",
"runner",
".",
"on",
"(",
"EVENT_RUN_BEGIN",
",",
... | Constructs a new `List` reporter instance.
@public
@class
@memberof Mocha.reporters
@extends Mocha.reporters.Base
@param {Runner} runner - Instance triggers reporter actions.
@param {Object} [options] - runner options | [
"Constructs",
"a",
"new",
"List",
"reporter",
"instance",
"."
] | 9b00fedb610241e33f7592c40164e42a38a793cf | https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/reporters/list.js#L37-L71 | train | List of tests in a phrase. | [
30522,
3853,
2862,
1006,
5479,
1010,
7047,
1007,
1063,
2918,
1012,
2655,
1006,
2023,
1010,
5479,
1010,
7047,
1007,
1025,
13075,
2969,
1027,
2023,
1025,
13075,
1050,
1027,
1014,
1025,
5479,
1012,
2006,
1006,
2724,
1035,
2448,
1035,
4088,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/RecentProjects/main.js | checkHovers | function checkHovers(pageX, pageY) {
$dropdown.children().each(function () {
var offset = $(this).offset(),
width = $(this).outerWidth(),
height = $(this).outerHeight();
if (pageX >= offset.left && pageX <= offset.left + width &&
page... | javascript | function checkHovers(pageX, pageY) {
$dropdown.children().each(function () {
var offset = $(this).offset(),
width = $(this).outerWidth(),
height = $(this).outerHeight();
if (pageX >= offset.left && pageX <= offset.left + width &&
page... | [
"function",
"checkHovers",
"(",
"pageX",
",",
"pageY",
")",
"{",
"$dropdown",
".",
"children",
"(",
")",
".",
"each",
"(",
"function",
"(",
")",
"{",
"var",
"offset",
"=",
"$",
"(",
"this",
")",
".",
"offset",
"(",
")",
",",
"width",
"=",
"$",
"(... | Check the list of items to see if any of them are hovered, and if so trigger a mouseenter.
Normally the mouseenter event handles this, but when a previous item is deleted and the next
item moves up to be underneath the mouse, we don't get a mouseenter event for that item. | [
"Check",
"the",
"list",
"of",
"items",
"to",
"see",
"if",
"any",
"of",
"them",
"are",
"hovered",
"and",
"if",
"so",
"trigger",
"a",
"mouseenter",
".",
"Normally",
"the",
"mouseenter",
"event",
"handles",
"this",
"but",
"when",
"a",
"previous",
"item",
"i... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RecentProjects/main.js#L98-L109 | train | check hovers | [
30522,
3853,
4638,
6806,
14028,
1006,
3931,
2595,
1010,
3931,
2100,
1007,
1063,
1002,
4530,
7698,
1012,
2336,
1006,
1007,
1012,
2169,
1006,
3853,
1006,
1007,
1063,
13075,
16396,
1027,
1002,
1006,
2023,
1007,
1012,
16396,
1006,
1007,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js | stopAndGo | function stopAndGo(aElements, fnCallback) {
var i = -1;
/*
* Visits the next element, taking the result of the previous callback into account.
*
* @param {boolean} bFound
* Whether an element was approved by the corresponding callback
* @returns {sap.ui.base.SyncPromise|any}
* First call retu... | javascript | function stopAndGo(aElements, fnCallback) {
var i = -1;
/*
* Visits the next element, taking the result of the previous callback into account.
*
* @param {boolean} bFound
* Whether an element was approved by the corresponding callback
* @returns {sap.ui.base.SyncPromise|any}
* First call retu... | [
"function",
"stopAndGo",
"(",
"aElements",
",",
"fnCallback",
")",
"{",
"var",
"i",
"=",
"-",
"1",
";",
"/*\n\t\t * Visits the next element, taking the result of the previous callback into account.\n\t\t *\n\t\t * @param {boolean} bFound\n\t\t * Whether an element was approved by the c... | Visits the given elements one-by-one, calls the given callback for each of them and stops
and waits for each sync promise returned by the callback before going on to the next element.
If a sync promise resolves with a truthy value, iteration stops and the corresponding element
becomes the result of the returned sync pr... | [
"Visits",
"the",
"given",
"elements",
"one",
"-",
"by",
"-",
"one",
"calls",
"the",
"given",
"callback",
"for",
"each",
"of",
"them",
"and",
"stops",
"and",
"waits",
"for",
"each",
"sync",
"promise",
"returned",
"by",
"the",
"callback",
"before",
"going",
... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js#L429-L454 | train | Calls the callback function for each element in the array and stops the iteration. | [
30522,
3853,
2644,
5685,
3995,
1006,
29347,
16930,
11187,
1010,
1042,
20909,
3363,
5963,
1007,
1063,
13075,
1045,
1027,
1011,
1015,
1025,
1013,
1008,
1008,
7879,
1996,
2279,
5783,
1010,
2635,
1996,
2765,
1997,
1996,
3025,
2655,
5963,
2046,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
firebase/firebase-js-sdk | packages/auth/demo/public/script.js | populateActionCodes | function populateActionCodes() {
var emailForSignIn = null;
var signInTime = 0;
if ('localStorage' in window && window['localStorage'] !== null) {
try {
// Try to parse as JSON first using new storage format.
var emailForSignInData =
JSON.parse(window.localStorage.getItem('emailForSignIn... | javascript | function populateActionCodes() {
var emailForSignIn = null;
var signInTime = 0;
if ('localStorage' in window && window['localStorage'] !== null) {
try {
// Try to parse as JSON first using new storage format.
var emailForSignInData =
JSON.parse(window.localStorage.getItem('emailForSignIn... | [
"function",
"populateActionCodes",
"(",
")",
"{",
"var",
"emailForSignIn",
"=",
"null",
";",
"var",
"signInTime",
"=",
"0",
";",
"if",
"(",
"'localStorage'",
"in",
"window",
"&&",
"window",
"[",
"'localStorage'",
"]",
"!==",
"null",
")",
"{",
"try",
"{",
... | Detects if an action code is passed in the URL, and populates accordingly
the input field for the confirm email verification process. | [
"Detects",
"if",
"an",
"action",
"code",
"is",
"passed",
"in",
"the",
"URL",
"and",
"populates",
"accordingly",
"the",
"input",
"field",
"for",
"the",
"confirm",
"email",
"verification",
"process",
"."
] | 491598a499813dacc23724de5e237ec220cc560e | https://github.com/firebase/firebase-js-sdk/blob/491598a499813dacc23724de5e237ec220cc560e/packages/auth/demo/public/script.js#L1128-L1171 | train | Populate the action codes | [
30522,
3853,
3769,
9869,
18908,
3258,
23237,
1006,
1007,
1063,
13075,
10373,
29278,
5332,
29076,
2078,
1027,
19701,
1025,
13075,
3696,
18447,
14428,
1027,
1014,
1025,
2065,
1006,
1005,
10575,
4263,
4270,
1005,
1999,
3332,
1004,
1004,
3332,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/command/KeyBindingManager.js | _addBinding | function _addBinding(commandID, keyBinding, platform, userBindings) {
var key,
result = null,
normalized,
normalizedDisplay,
explicitPlatform = keyBinding.platform || platform,
targetPlatform,
command,
bindingsToDelete = [],
... | javascript | function _addBinding(commandID, keyBinding, platform, userBindings) {
var key,
result = null,
normalized,
normalizedDisplay,
explicitPlatform = keyBinding.platform || platform,
targetPlatform,
command,
bindingsToDelete = [],
... | [
"function",
"_addBinding",
"(",
"commandID",
",",
"keyBinding",
",",
"platform",
",",
"userBindings",
")",
"{",
"var",
"key",
",",
"result",
"=",
"null",
",",
"normalized",
",",
"normalizedDisplay",
",",
"explicitPlatform",
"=",
"keyBinding",
".",
"platform",
... | @private
@param {string} commandID
@param {string|{{key: string, displayKey: string}}} keyBinding - a single shortcut.
@param {?string} platform
- "all" indicates all platforms, not overridable
- undefined indicates all platforms, overridden by platform-specific binding
@param {boolean=} userBindings true if adding a ... | [
"@private"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/KeyBindingManager.js#L636-L792 | train | Add a key binding to the command list | [
30522,
3853,
1035,
5587,
8428,
4667,
1006,
3094,
3593,
1010,
3145,
8428,
4667,
1010,
4132,
1010,
5310,
8428,
4667,
2015,
1007,
1063,
13075,
3145,
1010,
2765,
1027,
19701,
1010,
3671,
3550,
1010,
3671,
3550,
10521,
13068,
1010,
13216,
24759,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/no-duplicate-imports.js | handleImports | function handleImports(context, includeExports, importsInFile, exportsInFile) {
return function(node) {
const value = getValue(node);
if (value) {
checkAndReport(context, node, value, importsInFile, "import");
if (includeExports) {
checkAndReport(context, no... | javascript | function handleImports(context, includeExports, importsInFile, exportsInFile) {
return function(node) {
const value = getValue(node);
if (value) {
checkAndReport(context, node, value, importsInFile, "import");
if (includeExports) {
checkAndReport(context, no... | [
"function",
"handleImports",
"(",
"context",
",",
"includeExports",
",",
"importsInFile",
",",
"exportsInFile",
")",
"{",
"return",
"function",
"(",
"node",
")",
"{",
"const",
"value",
"=",
"getValue",
"(",
"node",
")",
";",
"if",
"(",
"value",
")",
"{",
... | @callback nodeCallback
@param {ASTNode} node - A node to handle.
Returns a function handling the imports of a given file
@param {RuleContext} context - The ESLint rule context object.
@param {boolean} includeExports - Whether or not to check for exports in addition to imports.
@param {string[]} importsInFile - The a... | [
"@callback",
"nodeCallback",
"@param",
"{",
"ASTNode",
"}",
"node",
"-",
"A",
"node",
"to",
"handle",
".",
"Returns",
"a",
"function",
"handling",
"the",
"imports",
"of",
"a",
"given",
"file"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-duplicate-imports.js#L63-L77 | train | Handle imports | [
30522,
3853,
5047,
5714,
25378,
1006,
6123,
1010,
2421,
10288,
25378,
1010,
17589,
2378,
8873,
2571,
1010,
14338,
2378,
8873,
2571,
1007,
1063,
2709,
3853,
1006,
13045,
1007,
1063,
9530,
3367,
3643,
1027,
2131,
10175,
5657,
1006,
13045,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/max-len.js | groupByLineNumber | function groupByLineNumber(acc, node) {
for (let i = node.loc.start.line; i <= node.loc.end.line; ++i) {
ensureArrayAndPush(acc, i, node);
}
return acc;
} | javascript | function groupByLineNumber(acc, node) {
for (let i = node.loc.start.line; i <= node.loc.end.line; ++i) {
ensureArrayAndPush(acc, i, node);
}
return acc;
} | [
"function",
"groupByLineNumber",
"(",
"acc",
",",
"node",
")",
"{",
"for",
"(",
"let",
"i",
"=",
"node",
".",
"loc",
".",
"start",
".",
"line",
";",
"i",
"<=",
"node",
".",
"loc",
".",
"end",
".",
"line",
";",
"++",
"i",
")",
"{",
"ensureArrayAnd... | A reducer to group an AST node by line number, both start and end.
@param {Object} acc the accumulator
@param {ASTNode} node the AST node in question
@returns {Object} the modified accumulator
@private | [
"A",
"reducer",
"to",
"group",
"an",
"AST",
"node",
"by",
"line",
"number",
"both",
"start",
"and",
"end",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/max-len.js#L253-L258 | train | group by line number | [
30522,
3853,
2177,
3762,
4179,
19172,
5677,
1006,
16222,
1010,
13045,
1007,
1063,
2005,
1006,
2292,
1045,
1027,
13045,
1012,
8840,
2278,
1012,
2707,
1012,
2240,
1025,
1045,
1026,
1027,
13045,
1012,
8840,
2278,
1012,
2203,
1012,
2240,
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... |
eslint/eslint | lib/rules/no-shadow-restricted-names.js | safelyShadowsUndefined | function safelyShadowsUndefined(variable) {
return variable.name === "undefined" &&
variable.references.every(ref => !ref.isWrite()) &&
variable.defs.every(def => def.node.type === "VariableDeclarator" && def.node.init === null);
} | javascript | function safelyShadowsUndefined(variable) {
return variable.name === "undefined" &&
variable.references.every(ref => !ref.isWrite()) &&
variable.defs.every(def => def.node.type === "VariableDeclarator" && def.node.init === null);
} | [
"function",
"safelyShadowsUndefined",
"(",
"variable",
")",
"{",
"return",
"variable",
".",
"name",
"===",
"\"undefined\"",
"&&",
"variable",
".",
"references",
".",
"every",
"(",
"ref",
"=>",
"!",
"ref",
".",
"isWrite",
"(",
")",
")",
"&&",
"variable",
".... | Determines if a variable safely shadows undefined.
This is the case when a variable named `undefined` is never assigned to a value (i.e. it always shares the same value
as the global).
@param {eslintScope.Variable} variable The variable to check
@returns {boolean} true if this variable safely shadows `undefined` | [
"Determines",
"if",
"a",
"variable",
"safely",
"shadows",
"undefined",
".",
"This",
"is",
"the",
"case",
"when",
"a",
"variable",
"named",
"undefined",
"is",
"never",
"assigned",
"to",
"a",
"value",
"(",
"i",
".",
"e",
".",
"it",
"always",
"shares",
"the... | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-shadow-restricted-names.js#L14-L18 | train | Check if a variable is shadowed to undefined | [
30522,
3853,
9689,
7377,
3527,
9333,
8630,
28344,
1006,
8023,
1007,
1063,
2709,
8023,
1012,
2171,
1027,
1027,
1027,
1000,
6151,
28344,
1000,
1004,
1004,
8023,
1012,
7604,
1012,
2296,
1006,
25416,
1027,
1028,
999,
25416,
1012,
2003,
26373,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/components/colors/colors.js | extractPalette | function extractPalette(parts, theme) {
// If the next section is one of the palettes we assume it's a two word palette
// Two word palette can be also written in camelCase, forming camelCase to dash-case
var isTwoWord = parts.length > 1 && colorPalettes.indexOf(parts[1]) !== -1;
var palette = ... | javascript | function extractPalette(parts, theme) {
// If the next section is one of the palettes we assume it's a two word palette
// Two word palette can be also written in camelCase, forming camelCase to dash-case
var isTwoWord = parts.length > 1 && colorPalettes.indexOf(parts[1]) !== -1;
var palette = ... | [
"function",
"extractPalette",
"(",
"parts",
",",
"theme",
")",
"{",
"// If the next section is one of the palettes we assume it's a two word palette",
"// Two word palette can be also written in camelCase, forming camelCase to dash-case",
"var",
"isTwoWord",
"=",
"parts",
".",
"length"... | Calculate the theme palette name
@param {Array} parts
@param {string} theme name
@return {string} | [
"Calculate",
"the",
"theme",
"palette",
"name"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/colors/colors.js#L194-L215 | train | Extract the palette from the next section of the palette list | [
30522,
3853,
14817,
12952,
7585,
1006,
3033,
1010,
4323,
1007,
1063,
1013,
1013,
2065,
1996,
2279,
2930,
2003,
2028,
1997,
1996,
27396,
2015,
2057,
7868,
2009,
1005,
1055,
1037,
2048,
2773,
27396,
1013,
1013,
2048,
2773,
27396,
2064,
2022,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
TryGhost/Ghost | core/server/models/base/index.js | onFetching | function onFetching(model, columns, options) {
if (options.forUpdate && options.transacting) {
options.query.forUpdate();
}
} | javascript | function onFetching(model, columns, options) {
if (options.forUpdate && options.transacting) {
options.query.forUpdate();
}
} | [
"function",
"onFetching",
"(",
"model",
",",
"columns",
",",
"options",
")",
"{",
"if",
"(",
"options",
".",
"forUpdate",
"&&",
"options",
".",
"transacting",
")",
"{",
"options",
".",
"query",
".",
"forUpdate",
"(",
")",
";",
"}",
"}"
] | http://knexjs.org/#Builder-forUpdate
https://dev.mysql.com/doc/refman/5.7/en/innodb-locking-reads.html
Lock target collection/model for further update operations.
This avoids collisions and possible content override cases. | [
"http",
":",
"//",
"knexjs",
".",
"org",
"/",
"#Builder",
"-",
"forUpdate",
"https",
":",
"//",
"dev",
".",
"mysql",
".",
"com",
"/",
"doc",
"/",
"refman",
"/",
"5",
".",
"7",
"/",
"en",
"/",
"innodb",
"-",
"locking",
"-",
"reads",
".",
"html"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/models/base/index.js#L286-L290 | train | When the database is fetched we need to fetch the record from the database | [
30522,
3853,
2006,
7959,
10649,
2075,
1006,
2944,
1010,
7753,
1010,
7047,
1007,
1063,
2065,
1006,
7047,
1012,
2005,
6279,
13701,
1004,
1004,
7047,
1012,
9099,
18908,
2075,
1007,
1063,
7047,
1012,
23032,
1012,
2005,
6279,
13701,
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... |
adobe/brackets | src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js | function (msgStr) {
var msg;
try {
msg = JSON.parse(msgStr);
} catch (e) {
console.log("[Brackets LiveDev] Malformed message received: ", msgStr);
return;
}
// delegates handling/routing to MessageBroker.
... | javascript | function (msgStr) {
var msg;
try {
msg = JSON.parse(msgStr);
} catch (e) {
console.log("[Brackets LiveDev] Malformed message received: ", msgStr);
return;
}
// delegates handling/routing to MessageBroker.
... | [
"function",
"(",
"msgStr",
")",
"{",
"var",
"msg",
";",
"try",
"{",
"msg",
"=",
"JSON",
".",
"parse",
"(",
"msgStr",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"console",
".",
"log",
"(",
"\"[Brackets LiveDev] Malformed message received: \"",
",",
"msgS... | Handles a message from the transport. Parses it as JSON and delegates
to MessageBroker who is in charge of routing them to handlers.
@param {string} msgStr The protocol message as stringified JSON. | [
"Handles",
"a",
"message",
"from",
"the",
"transport",
".",
"Parses",
"it",
"as",
"JSON",
"and",
"delegates",
"to",
"MessageBroker",
"who",
"is",
"in",
"charge",
"of",
"routing",
"them",
"to",
"handlers",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js#L353-L363 | train | Parse a message and trigger a message broker | [
30522,
3853,
1006,
5796,
5620,
16344,
1007,
1063,
13075,
5796,
2290,
1025,
3046,
1063,
5796,
2290,
1027,
1046,
3385,
1012,
11968,
3366,
1006,
5796,
5620,
16344,
1007,
1025,
1065,
4608,
1006,
1041,
1007,
1063,
10122,
1012,
8833,
1006,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
mochajs/mocha | lib/reporters/html.js | makeUrl | function makeUrl(s) {
var search = window.location.search;
// Remove previous grep query parameter if present
if (search) {
search = search.replace(/[?&]grep=[^&\s]*/g, '').replace(/^&/, '?');
}
return (
window.location.pathname +
(search ? search + '&' : '?') +
'grep=' +
encodeURICompon... | javascript | function makeUrl(s) {
var search = window.location.search;
// Remove previous grep query parameter if present
if (search) {
search = search.replace(/[?&]grep=[^&\s]*/g, '').replace(/^&/, '?');
}
return (
window.location.pathname +
(search ? search + '&' : '?') +
'grep=' +
encodeURICompon... | [
"function",
"makeUrl",
"(",
"s",
")",
"{",
"var",
"search",
"=",
"window",
".",
"location",
".",
"search",
";",
"// Remove previous grep query parameter if present",
"if",
"(",
"search",
")",
"{",
"search",
"=",
"search",
".",
"replace",
"(",
"/",
"[?&]grep=[^... | Makes a URL, preserving querystring ("search") parameters.
@param {string} s
@return {string} A new URL. | [
"Makes",
"a",
"URL",
"preserving",
"querystring",
"(",
"search",
")",
"parameters",
"."
] | 9b00fedb610241e33f7592c40164e42a38a793cf | https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/reporters/html.js#L255-L269 | train | Make a url from a string | [
30522,
3853,
2191,
3126,
2140,
1006,
1055,
1007,
1063,
13075,
3945,
1027,
3332,
1012,
3295,
1012,
3945,
1025,
1013,
1013,
6366,
3025,
24665,
13699,
23032,
16381,
2065,
2556,
2065,
1006,
3945,
1007,
1063,
3945,
1027,
3945,
1012,
5672,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mochajs/mocha | lib/reporters/nyan.js | NyanCat | function NyanCat(runner, options) {
Base.call(this, runner, options);
var self = this;
var width = (Base.window.width * 0.75) | 0;
var nyanCatWidth = (this.nyanCatWidth = 11);
this.colorIndex = 0;
this.numberOfLines = 4;
this.rainbowColors = self.generateColors();
this.scoreboardWidth = 5;
this.tick... | javascript | function NyanCat(runner, options) {
Base.call(this, runner, options);
var self = this;
var width = (Base.window.width * 0.75) | 0;
var nyanCatWidth = (this.nyanCatWidth = 11);
this.colorIndex = 0;
this.numberOfLines = 4;
this.rainbowColors = self.generateColors();
this.scoreboardWidth = 5;
this.tick... | [
"function",
"NyanCat",
"(",
"runner",
",",
"options",
")",
"{",
"Base",
".",
"call",
"(",
"this",
",",
"runner",
",",
"options",
")",
";",
"var",
"self",
"=",
"this",
";",
"var",
"width",
"=",
"(",
"Base",
".",
"window",
".",
"width",
"*",
"0.75",
... | Constructs a new `Nyan` reporter instance.
@public
@class Nyan
@memberof Mocha.reporters
@extends Mocha.reporters.Base
@param {Runner} runner - Instance triggers reporter actions.
@param {Object} [options] - runner options | [
"Constructs",
"a",
"new",
"Nyan",
"reporter",
"instance",
"."
] | 9b00fedb610241e33f7592c40164e42a38a793cf | https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/reporters/nyan.js#L34-L73 | train | Nyan Cat class | [
30522,
3853,
6396,
2319,
11266,
1006,
5479,
1010,
7047,
1007,
1063,
2918,
1012,
2655,
1006,
2023,
1010,
5479,
1010,
7047,
1007,
1025,
13075,
2969,
1027,
2023,
1025,
13075,
9381,
1027,
1006,
2918,
1012,
3332,
1012,
9381,
1008,
1014,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/document/DocumentCommandHandlers.js | handleFileClose | function handleFileClose(commandData) {
var file,
promptOnly,
_forceClose,
_spawnedRequest,
paneId = MainViewManager.ACTIVE_PANE;
if (commandData) {
file = commandData.file;
promptOnly = commandData.promptOnly;
... | javascript | function handleFileClose(commandData) {
var file,
promptOnly,
_forceClose,
_spawnedRequest,
paneId = MainViewManager.ACTIVE_PANE;
if (commandData) {
file = commandData.file;
promptOnly = commandData.promptOnly;
... | [
"function",
"handleFileClose",
"(",
"commandData",
")",
"{",
"var",
"file",
",",
"promptOnly",
",",
"_forceClose",
",",
"_spawnedRequest",
",",
"paneId",
"=",
"MainViewManager",
".",
"ACTIVE_PANE",
";",
"if",
"(",
"commandData",
")",
"{",
"file",
"=",
"command... | Closes the specified file: removes it from the workingset, and closes the main editor if one
is open. Prompts user about saving changes first, if document is dirty.
@param {?{file: File, promptOnly:boolean}} commandData Optional bag of arguments:
file - File to close; assumes the current document if not specified.
pr... | [
"Closes",
"the",
"specified",
"file",
":",
"removes",
"it",
"from",
"the",
"workingset",
"and",
"closes",
"the",
"main",
"editor",
"if",
"one",
"is",
"open",
".",
"Prompts",
"user",
"about",
"saving",
"changes",
"first",
"if",
"document",
"is",
"dirty",
".... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentCommandHandlers.js#L1181-L1295 | train | Handle file close | [
30522,
3853,
5047,
8873,
2571,
20464,
9232,
1006,
3094,
2850,
2696,
1007,
1063,
13075,
5371,
1010,
25732,
2239,
2135,
1010,
1035,
2486,
20464,
9232,
1010,
1035,
18379,
2890,
15500,
1010,
6090,
7416,
2094,
1027,
2364,
8584,
24805,
4590,
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... |
eslint/eslint | tools/fuzzer-runner.js | run | function run({ amount = 300, fuzzBrokenAutofixes = true } = {}) {
const crashTestCount = amount * CRASH_AUTOFIX_TEST_COUNT_RATIO;
const autofixTestCount = fuzzBrokenAutofixes ? amount : 0;
/*
* To keep the progress bar moving at a roughly constant speed, apply a different weight for finishing
* a... | javascript | function run({ amount = 300, fuzzBrokenAutofixes = true } = {}) {
const crashTestCount = amount * CRASH_AUTOFIX_TEST_COUNT_RATIO;
const autofixTestCount = fuzzBrokenAutofixes ? amount : 0;
/*
* To keep the progress bar moving at a roughly constant speed, apply a different weight for finishing
* a... | [
"function",
"run",
"(",
"{",
"amount",
"=",
"300",
",",
"fuzzBrokenAutofixes",
"=",
"true",
"}",
"=",
"{",
"}",
")",
"{",
"const",
"crashTestCount",
"=",
"amount",
"*",
"CRASH_AUTOFIX_TEST_COUNT_RATIO",
";",
"const",
"autofixTestCount",
"=",
"fuzzBrokenAutofixes... | ------------------------------------------------------------------------------ Public API ------------------------------------------------------------------------------
Runs the fuzzer and outputs a progress bar
@param {Object} [options] Options for the fuzzer
@param {number} [options.amount=300] A positive integer in... | [
"------------------------------------------------------------------------------",
"Public",
"API",
"------------------------------------------------------------------------------",
"Runs",
"the",
"fuzzer",
"and",
"outputs",
"a",
"progress",
"bar"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/tools/fuzzer-runner.js#L41-L79 | train | Run the autofix - fuzzer | [
30522,
3853,
2448,
1006,
1063,
3815,
1027,
3998,
1010,
11865,
13213,
29162,
4887,
3406,
8873,
20156,
1027,
2995,
1065,
1027,
1063,
1065,
1007,
1063,
9530,
3367,
5823,
22199,
3597,
16671,
1027,
3815,
1008,
5823,
1035,
8285,
8873,
2595,
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... |
summernote/summernote | src/js/base/core/dom.js | isVisiblePoint | function isVisiblePoint(point) {
if (isText(point.node) || !hasChildren(point.node) || isEmpty(point.node)) {
return true;
}
const leftNode = point.node.childNodes[point.offset - 1];
const rightNode = point.node.childNodes[point.offset];
if ((!leftNode || isVoid(leftNode)) && (!rightNode || isVoid(rightN... | javascript | function isVisiblePoint(point) {
if (isText(point.node) || !hasChildren(point.node) || isEmpty(point.node)) {
return true;
}
const leftNode = point.node.childNodes[point.offset - 1];
const rightNode = point.node.childNodes[point.offset];
if ((!leftNode || isVoid(leftNode)) && (!rightNode || isVoid(rightN... | [
"function",
"isVisiblePoint",
"(",
"point",
")",
"{",
"if",
"(",
"isText",
"(",
"point",
".",
"node",
")",
"||",
"!",
"hasChildren",
"(",
"point",
".",
"node",
")",
"||",
"isEmpty",
"(",
"point",
".",
"node",
")",
")",
"{",
"return",
"true",
";",
"... | returns whether point is visible (can set cursor) or not.
@param {BoundaryPoint} point
@return {Boolean} | [
"returns",
"whether",
"point",
"is",
"visible",
"(",
"can",
"set",
"cursor",
")",
"or",
"not",
"."
] | 8dcafb8107453006b905ef697a529c42e76beb3f | https://github.com/summernote/summernote/blob/8dcafb8107453006b905ef697a529c42e76beb3f/src/js/base/core/dom.js#L602-L614 | train | Check if point is visible | [
30522,
3853,
2003,
11365,
7028,
8400,
1006,
2391,
1007,
1063,
2065,
1006,
21541,
10288,
2102,
1006,
2391,
1012,
13045,
1007,
1064,
1064,
999,
2038,
19339,
7389,
1006,
2391,
1012,
13045,
1007,
1064,
1064,
2003,
6633,
13876,
2100,
1006,
2391,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.commons/src/sap/ui/commons/FormattedTextView.js | function (aControls) {
if (this.hasControls()) {
this.removeAllAggregation("controls");
}
var bIsArray = Array.isArray(aControls);
if (bIsArray && aControls.length > 0) {
// iterate through the given array but suppress invalidate
for (var i = 0; i < aControls.length; i++) {
this.addAggrega... | javascript | function (aControls) {
if (this.hasControls()) {
this.removeAllAggregation("controls");
}
var bIsArray = Array.isArray(aControls);
if (bIsArray && aControls.length > 0) {
// iterate through the given array but suppress invalidate
for (var i = 0; i < aControls.length; i++) {
this.addAggrega... | [
"function",
"(",
"aControls",
")",
"{",
"if",
"(",
"this",
".",
"hasControls",
"(",
")",
")",
"{",
"this",
".",
"removeAllAggregation",
"(",
"\"controls\"",
")",
";",
"}",
"var",
"bIsArray",
"=",
"Array",
".",
"isArray",
"(",
"aControls",
")",
";",
"if... | Sets the controls to be rendered.
@param {array} aControls Controls should be rendered
@private | [
"Sets",
"the",
"controls",
"to",
"be",
"rendered",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/FormattedTextView.js#L227-L240 | train | Adds the given controls to the control collection. | [
30522,
3853,
1006,
9353,
12162,
13153,
2015,
1007,
1063,
2065,
1006,
2023,
1012,
2038,
8663,
13181,
4877,
1006,
1007,
1007,
1063,
2023,
1012,
6366,
25425,
13871,
2890,
12540,
1006,
1000,
7711,
1000,
1007,
1025,
1065,
13075,
20377,
2906,
944... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Context.js | fetchPrimitiveValue | function fetchPrimitiveValue(oContext, sPath, bExternalFormat, bCached) {
var oError,
aPromises = [oContext.fetchValue(sPath, null, bCached)],
sResolvedPath = oContext.getPath(sPath);
if (bExternalFormat) {
aPromises.push(
oContext.oModel.getMetaModel().fetchUI5Type(sResolvedPath));
}
return SyncP... | javascript | function fetchPrimitiveValue(oContext, sPath, bExternalFormat, bCached) {
var oError,
aPromises = [oContext.fetchValue(sPath, null, bCached)],
sResolvedPath = oContext.getPath(sPath);
if (bExternalFormat) {
aPromises.push(
oContext.oModel.getMetaModel().fetchUI5Type(sResolvedPath));
}
return SyncP... | [
"function",
"fetchPrimitiveValue",
"(",
"oContext",
",",
"sPath",
",",
"bExternalFormat",
",",
"bCached",
")",
"{",
"var",
"oError",
",",
"aPromises",
"=",
"[",
"oContext",
".",
"fetchValue",
"(",
"sPath",
",",
"null",
",",
"bCached",
")",
"]",
",",
"sReso... | /*
Fetches and formats the primitive value at the given path.
@param {sap.ui.model.odata.v4.Context} oContext The context
@param {string} sPath The requested path
@param {boolean} [bExternalFormat=false]
If <code>true</code>, the value is returned in external format using a UI5 type for the
given property path that fo... | [
"/",
"*",
"Fetches",
"and",
"formats",
"the",
"primitive",
"value",
"at",
"the",
"given",
"path",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/Context.js#L34-L54 | train | Fetch a primitive value from the given context | [
30522,
3853,
18584,
18098,
27605,
6024,
10175,
5657,
1006,
1051,
8663,
18209,
1010,
14690,
2232,
1010,
2022,
18413,
11795,
2389,
14192,
4017,
1010,
4647,
15395,
2094,
1007,
1063,
13075,
1051,
2121,
29165,
1010,
19804,
20936,
8583,
1027,
1031,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GitbookIO/gitbook | lib/utils/fs.js | writeStream | function writeStream(filename, st) {
var d = Promise.defer();
var wstream = fs.createWriteStream(filename);
var cleanup = function() {
destroy(wstream);
wstream.removeAllListeners();
};
wstream.on('finish', function () {
cleanup();
d.resolve();
});
wstream.o... | javascript | function writeStream(filename, st) {
var d = Promise.defer();
var wstream = fs.createWriteStream(filename);
var cleanup = function() {
destroy(wstream);
wstream.removeAllListeners();
};
wstream.on('finish', function () {
cleanup();
d.resolve();
});
wstream.o... | [
"function",
"writeStream",
"(",
"filename",
",",
"st",
")",
"{",
"var",
"d",
"=",
"Promise",
".",
"defer",
"(",
")",
";",
"var",
"wstream",
"=",
"fs",
".",
"createWriteStream",
"(",
"filename",
")",
";",
"var",
"cleanup",
"=",
"function",
"(",
")",
"... | Write a stream to a file | [
"Write",
"a",
"stream",
"to",
"a",
"file"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/utils/fs.js#L14-L40 | train | Write a stream to a file | [
30522,
3853,
7009,
25379,
1006,
5371,
18442,
1010,
2358,
1007,
1063,
13075,
1040,
1027,
4872,
1012,
13366,
2121,
1006,
1007,
1025,
13075,
1059,
21422,
1027,
1042,
2015,
1012,
3443,
26373,
21422,
1006,
5371,
18442,
1007,
1025,
13075,
27686,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
elastic/elasticsearch-js | api/api/update.js | buildUpdate | function buildUpdate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [update](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html) request
*
* @param {string} id - Document ID
* ... | javascript | function buildUpdate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [update](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html) request
*
* @param {string} id - Document ID
* ... | [
"function",
"buildUpdate",
"(",
"opts",
")",
"{",
"// eslint-disable-next-line no-unused-vars",
"const",
"{",
"makeRequest",
",",
"ConfigurationError",
",",
"handleError",
",",
"snakeCaseKeys",
"}",
"=",
"opts",
"/**\n * Perform a [update](http://www.elastic.co/guide/en/elast... | /* eslint camelcase: 0 /* eslint no-unused-vars: 0 | [
"/",
"*",
"eslint",
"camelcase",
":",
"0",
"/",
"*",
"eslint",
"no",
"-",
"unused",
"-",
"vars",
":",
"0"
] | 4fc4699a4d4474d7887bc7757e0269218a859294 | https://github.com/elastic/elasticsearch-js/blob/4fc4699a4d4474d7887bc7757e0269218a859294/api/api/update.js#L25-L144 | train | Build an update operation. | [
30522,
3853,
3857,
6279,
13701,
1006,
23569,
2015,
1007,
1063,
1013,
1013,
9686,
4115,
2102,
1011,
4487,
19150,
1011,
30524,
1033,
1006,
8299,
1024,
1013,
1013,
7479,
1012,
21274,
1012,
2522,
1013,
5009,
1013,
4372,
1013,
21274,
17310,
1114... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
electron/electron | script/release-notes/notes.js | runRetryable | async function runRetryable (fn, maxRetries) {
let lastError
for (let i = 0; i < maxRetries; i++) {
try {
return await fn()
} catch (error) {
await new Promise((resolve, reject) => setTimeout(resolve, CHECK_INTERVAL))
lastError = error
}
}
// Silently eat 404s.
if (lastError.stat... | javascript | async function runRetryable (fn, maxRetries) {
let lastError
for (let i = 0; i < maxRetries; i++) {
try {
return await fn()
} catch (error) {
await new Promise((resolve, reject) => setTimeout(resolve, CHECK_INTERVAL))
lastError = error
}
}
// Silently eat 404s.
if (lastError.stat... | [
"async",
"function",
"runRetryable",
"(",
"fn",
",",
"maxRetries",
")",
"{",
"let",
"lastError",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
"<",
"maxRetries",
";",
"i",
"++",
")",
"{",
"try",
"{",
"return",
"await",
"fn",
"(",
")",
"}",
"catch",
... | helper function to add some resiliency to volatile GH api endpoints | [
"helper",
"function",
"to",
"add",
"some",
"resiliency",
"to",
"volatile",
"GH",
"api",
"endpoints"
] | 6e29611788277729647acf465f10db1ea6f15788 | https://github.com/electron/electron/blob/6e29611788277729647acf465f10db1ea6f15788/script/release-notes/notes.js#L305-L317 | train | Run a function in a retryable manner | [
30522,
2004,
6038,
2278,
3853,
2448,
13465,
20444,
3468,
1006,
1042,
2078,
1010,
4098,
13465,
5134,
1007,
1063,
2292,
2197,
2121,
29165,
2005,
1006,
2292,
1045,
1027,
1014,
1025,
1045,
1026,
4098,
13465,
5134,
1025,
1045,
1009,
1009,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/search/FindUtils.js | parseQueryInfo | function parseQueryInfo(queryInfo) {
var queryExpr;
if (!queryInfo || !queryInfo.query) {
return {empty: true};
}
// For now, treat all matches as multiline (i.e. ^/$ match on every line, not the whole
// document). This is consistent with how single-file find works... | javascript | function parseQueryInfo(queryInfo) {
var queryExpr;
if (!queryInfo || !queryInfo.query) {
return {empty: true};
}
// For now, treat all matches as multiline (i.e. ^/$ match on every line, not the whole
// document). This is consistent with how single-file find works... | [
"function",
"parseQueryInfo",
"(",
"queryInfo",
")",
"{",
"var",
"queryExpr",
";",
"if",
"(",
"!",
"queryInfo",
"||",
"!",
"queryInfo",
".",
"query",
")",
"{",
"return",
"{",
"empty",
":",
"true",
"}",
";",
"}",
"// For now, treat all matches as multiline (i.e... | Parses the given query into a regexp, and returns whether it was valid or not.
@param {{query: string, caseSensitive: boolean, isRegexp: boolean}} queryInfo
@return {{queryExpr: RegExp, valid: boolean, empty: boolean, error: string}}
queryExpr - the regexp representing the query
valid - set to true if query is a nonemp... | [
"Parses",
"the",
"given",
"query",
"into",
"a",
"regexp",
"and",
"returns",
"whether",
"it",
"was",
"valid",
"or",
"not",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindUtils.js#L308-L335 | train | Parse a query string into a regexp or empty string | [
30522,
3853,
11968,
3366,
4226,
2854,
2378,
14876,
1006,
23032,
2378,
14876,
1007,
1063,
13075,
23032,
10288,
18098,
1025,
2065,
1006,
999,
23032,
2378,
14876,
1064,
1064,
999,
23032,
2378,
14876,
1012,
23032,
1007,
1063,
2709,
1063,
4064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
vuejs/vue-devtools | src/backend/index.js | mark | function mark (instance) {
if (!instanceMap.has(instance.__VUE_DEVTOOLS_UID__)) {
instanceMap.set(instance.__VUE_DEVTOOLS_UID__, instance)
instance.$on('hook:beforeDestroy', function () {
instanceMap.delete(instance.__VUE_DEVTOOLS_UID__)
})
}
} | javascript | function mark (instance) {
if (!instanceMap.has(instance.__VUE_DEVTOOLS_UID__)) {
instanceMap.set(instance.__VUE_DEVTOOLS_UID__, instance)
instance.$on('hook:beforeDestroy', function () {
instanceMap.delete(instance.__VUE_DEVTOOLS_UID__)
})
}
} | [
"function",
"mark",
"(",
"instance",
")",
"{",
"if",
"(",
"!",
"instanceMap",
".",
"has",
"(",
"instance",
".",
"__VUE_DEVTOOLS_UID__",
")",
")",
"{",
"instanceMap",
".",
"set",
"(",
"instance",
".",
"__VUE_DEVTOOLS_UID__",
",",
"instance",
")",
"instance",
... | Mark an instance as captured and store it in the instance map.
@param {Vue} instance | [
"Mark",
"an",
"instance",
"as",
"captured",
"and",
"store",
"it",
"in",
"the",
"instance",
"map",
"."
] | 4de4b86388453cd07f0c1bf967d43a4dd4b011c9 | https://github.com/vuejs/vue-devtools/blob/4de4b86388453cd07f0c1bf967d43a4dd4b011c9/src/backend/index.js#L479-L486 | train | Mark an instance as unused | [
30522,
3853,
2928,
1006,
6013,
1007,
1063,
2065,
1006,
999,
6013,
2863,
2361,
1012,
2038,
1006,
6013,
1012,
1035,
1035,
24728,
2063,
1035,
16475,
3406,
27896,
1035,
21318,
2094,
1035,
1035,
1007,
1007,
1063,
6013,
2863,
2361,
1012,
2275,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aframevr/aframe | src/components/obj-model.js | function () {
var material = this.el.components.material;
if (!material) { return; }
this.model.traverse(function (child) {
if (child instanceof THREE.Mesh) {
child.material = material.material;
}
});
} | javascript | function () {
var material = this.el.components.material;
if (!material) { return; }
this.model.traverse(function (child) {
if (child instanceof THREE.Mesh) {
child.material = material.material;
}
});
} | [
"function",
"(",
")",
"{",
"var",
"material",
"=",
"this",
".",
"el",
".",
"components",
".",
"material",
";",
"if",
"(",
"!",
"material",
")",
"{",
"return",
";",
"}",
"this",
".",
"model",
".",
"traverse",
"(",
"function",
"(",
"child",
")",
"{",... | Apply material from material component recursively. | [
"Apply",
"material",
"from",
"material",
"component",
"recursively",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/obj-model.js#L92-L100 | train | set material to the component | [
30522,
3853,
1006,
1007,
1063,
13075,
3430,
1027,
2023,
1012,
3449,
1012,
6177,
1012,
3430,
1025,
2065,
1006,
999,
3430,
1007,
1063,
2709,
1025,
1065,
2023,
1012,
2944,
1012,
20811,
1006,
3853,
1006,
2775,
1007,
1063,
2065,
1006,
2775,
60... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.ux3/src/sap/ui/ux3/NotificationBarRenderer.js | function (oRm, sUri, bMessageNotifier) {
if (sUri == null || sUri == "") {
var icon = new Icon({
useIconTooltip: false
});
icon.addStyleClass("sapUiNotifierIcon");
if (bMessageNotifier) {
icon.setSrc("sap-icon://alert");
} else {
icon.setSrc("sap-icon://notification-2");
}
... | javascript | function (oRm, sUri, bMessageNotifier) {
if (sUri == null || sUri == "") {
var icon = new Icon({
useIconTooltip: false
});
icon.addStyleClass("sapUiNotifierIcon");
if (bMessageNotifier) {
icon.setSrc("sap-icon://alert");
} else {
icon.setSrc("sap-icon://notification-2");
}
... | [
"function",
"(",
"oRm",
",",
"sUri",
",",
"bMessageNotifier",
")",
"{",
"if",
"(",
"sUri",
"==",
"null",
"||",
"sUri",
"==",
"\"\"",
")",
"{",
"var",
"icon",
"=",
"new",
"Icon",
"(",
"{",
"useIconTooltip",
":",
"false",
"}",
")",
";",
"icon",
".",
... | Renders the notifier's icon. If there is no icon set a default icon is
used | [
"Renders",
"the",
"notifier",
"s",
"icon",
".",
"If",
"there",
"is",
"no",
"icon",
"set",
"a",
"default",
"icon",
"is",
"used"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/NotificationBarRenderer.js#L430-L452 | train | Renders the notification icon | [
30522,
3853,
1006,
2030,
2213,
1010,
7505,
2072,
1010,
1038,
7834,
3736,
6914,
4140,
18095,
1007,
1063,
2065,
1006,
7505,
2072,
1027,
1027,
19701,
1064,
1064,
7505,
2072,
1027,
1027,
1000,
1000,
1007,
1063,
13075,
12696,
1027,
2047,
12696,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Component.js | createMetadataProxy | function createMetadataProxy(oMetadata, oManifest) {
// create a proxy for the metadata object and simulate to be an
// instance of the original metadata object of the Component
// => retrieving the prototype from the original metadata to
// support to proxy sub-classes of ComponentMetadata
var oMetadataP... | javascript | function createMetadataProxy(oMetadata, oManifest) {
// create a proxy for the metadata object and simulate to be an
// instance of the original metadata object of the Component
// => retrieving the prototype from the original metadata to
// support to proxy sub-classes of ComponentMetadata
var oMetadataP... | [
"function",
"createMetadataProxy",
"(",
"oMetadata",
",",
"oManifest",
")",
"{",
"// create a proxy for the metadata object and simulate to be an",
"// instance of the original metadata object of the Component",
"// => retrieving the prototype from the original metadata to",
"// support to ... | Utility function which creates a metadata proxy object for the given
metadata object
@param {sap.ui.core.ComponentMetadata} oMetadata the Component metadata
@param {sap.ui.core.Manifest} oManifest the manifest
@return {sap.ui.core.ComponentMetadata} a metadata proxy object | [
"Utility",
"function",
"which",
"creates",
"a",
"metadata",
"proxy",
"object",
"for",
"the",
"given",
"metadata",
"object"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/Component.js#L134-L170 | train | Creates a proxy for the metadata object. | [
30522,
3853,
3443,
11368,
8447,
2696,
21572,
18037,
1006,
18168,
12928,
2850,
2696,
1010,
16640,
29323,
3367,
1007,
1063,
1013,
1013,
3443,
1037,
24540,
2005,
1996,
27425,
4874,
1998,
26633,
2000,
2022,
2019,
1013,
1013,
6013,
1997,
1996,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/LiveDevelopment/LiveDevServerManager.js | removeServer | function removeServer(provider) {
var i;
for (i = 0; i < _serverProviders.length; i++) {
if (provider === _serverProviders[i]) {
_serverProviders.splice(i, 1);
}
}
} | javascript | function removeServer(provider) {
var i;
for (i = 0; i < _serverProviders.length; i++) {
if (provider === _serverProviders[i]) {
_serverProviders.splice(i, 1);
}
}
} | [
"function",
"removeServer",
"(",
"provider",
")",
"{",
"var",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"_serverProviders",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"provider",
"===",
"_serverProviders",
"[",
"i",
"]",
")",
"{"... | Remove a server from the list of the registered providers.
@param {{object}} provider The provider to be removed. | [
"Remove",
"a",
"server",
"from",
"the",
"list",
"of",
"the",
"registered",
"providers",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevServerManager.js#L113-L120 | train | Remove a server from the list of server providers | [
30522,
3853,
20362,
2121,
6299,
1006,
10802,
1007,
1063,
13075,
1045,
1025,
2005,
1006,
1045,
1027,
1014,
1025,
1045,
1026,
1035,
8241,
21572,
17258,
2545,
1012,
3091,
1025,
1045,
1009,
1009,
1007,
1063,
2065,
1006,
10802,
1027,
1027,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cytoscape/cytoscape.js | dist/cytoscape.esm.js | setupShapeColor | function setupShapeColor() {
var bgOpy = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : bgOpacity;
r.eleFillStyle(context, node, bgOpy);
} | javascript | function setupShapeColor() {
var bgOpy = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : bgOpacity;
r.eleFillStyle(context, node, bgOpy);
} | [
"function",
"setupShapeColor",
"(",
")",
"{",
"var",
"bgOpy",
"=",
"arguments",
".",
"length",
">",
"0",
"&&",
"arguments",
"[",
"0",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"0",
"]",
":",
"bgOpacity",
";",
"r",
".",
"eleFillStyle",
"(",
"conte... | so borders are square with the node shape | [
"so",
"borders",
"are",
"square",
"with",
"the",
"node",
"shape"
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L28500-L28503 | train | Setup shape color | [
30522,
3853,
16437,
7377,
5051,
18717,
1006,
1007,
1063,
13075,
1038,
3995,
7685,
1027,
9918,
1012,
3091,
1028,
1014,
1004,
1004,
9918,
1031,
1014,
1033,
999,
1027,
1027,
6151,
28344,
1029,
9918,
1031,
1014,
1033,
1024,
1038,
3995,
19498,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/base/ManagedObject.js | becameInvalid | function becameInvalid(oBindingInfo) {
var aParts = oBindingInfo.parts,
i;
if (aParts) {
if (aParts.length == 1) {
// simple property binding: invalid when the model has the same name (or updateall) and when the model instance differs
return (bUpdateAll || aParts[0].model == sModelName) && !oBi... | javascript | function becameInvalid(oBindingInfo) {
var aParts = oBindingInfo.parts,
i;
if (aParts) {
if (aParts.length == 1) {
// simple property binding: invalid when the model has the same name (or updateall) and when the model instance differs
return (bUpdateAll || aParts[0].model == sModelName) && !oBi... | [
"function",
"becameInvalid",
"(",
"oBindingInfo",
")",
"{",
"var",
"aParts",
"=",
"oBindingInfo",
".",
"parts",
",",
"i",
";",
"if",
"(",
"aParts",
")",
"{",
"if",
"(",
"aParts",
".",
"length",
"==",
"1",
")",
"{",
"// simple property binding: invalid when t... | /*
Checks whether the binding for the given oBindingInfo became invalid because
of the current model change (as identified by bUpdateAll and sModelName).
Precondition: oBindingInfo contains a 'binding' object
@param oBindingInfo
@returns {boolean} | [
"/",
"*",
"Checks",
"whether",
"the",
"binding",
"for",
"the",
"given",
"oBindingInfo",
"became",
"invalid",
"because",
"of",
"the",
"current",
"model",
"change",
"(",
"as",
"identified",
"by",
"bUpdateAll",
"and",
"sModelName",
")",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/base/ManagedObject.js#L4161-L4181 | train | Checks if the binding is invalid | [
30522,
3853,
2150,
2378,
10175,
3593,
1006,
27885,
22254,
2075,
2378,
14876,
1007,
1063,
13075,
4237,
2015,
1027,
27885,
22254,
2075,
2378,
14876,
1012,
3033,
1010,
1045,
1025,
2065,
1006,
4237,
2015,
1007,
1063,
2065,
1006,
4237,
2015,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/AnnotationHelper.js | function (vRawValue, oDetails) {
var sPath = typeof vRawValue === "string"
? "/" + oDetails.schemaChildName + "/" + vRawValue
: oDetails.context.getPath();
return oDetails.$$valueAsPromise
? oDetails.context.getModel().fetchValueListType(sPath).unwrap()
: oDetails.context.getModel().getVa... | javascript | function (vRawValue, oDetails) {
var sPath = typeof vRawValue === "string"
? "/" + oDetails.schemaChildName + "/" + vRawValue
: oDetails.context.getPath();
return oDetails.$$valueAsPromise
? oDetails.context.getModel().fetchValueListType(sPath).unwrap()
: oDetails.context.getModel().getVa... | [
"function",
"(",
"vRawValue",
",",
"oDetails",
")",
"{",
"var",
"sPath",
"=",
"typeof",
"vRawValue",
"===",
"\"string\"",
"?",
"\"/\"",
"+",
"oDetails",
".",
"schemaChildName",
"+",
"\"/\"",
"+",
"vRawValue",
":",
"oDetails",
".",
"context",
".",
"getPath",
... | Determines which type of value list exists for the given property.
@param {any} vRawValue
The raw value from the meta model; must be either a property or a path pointing to
a property (relative to <code>oDetails.schemaChildName</code>)
@param {object} oDetails
The details object
@param {boolean} [oDetails.$$valueAsPro... | [
"Determines",
"which",
"type",
"of",
"value",
"list",
"exists",
"for",
"the",
"given",
"property",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/AnnotationHelper.js#L331-L339 | train | Returns the value type of the given value. | [
30522,
3853,
1006,
27830,
10376,
10175,
5657,
1010,
24040,
22081,
1007,
1063,
13075,
14690,
2232,
1027,
2828,
11253,
27830,
10376,
10175,
5657,
1027,
1027,
1027,
1000,
5164,
1000,
1029,
1000,
1013,
1000,
1009,
24040,
22081,
1012,
8040,
28433,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
eslint/eslint | lib/rules/padding-line-between-statements.js | isBlockLikeStatement | function isBlockLikeStatement(sourceCode, node) {
// do-while with a block is a block-like statement.
if (node.type === "DoWhileStatement" && node.body.type === "BlockStatement") {
return true;
}
/*
* IIFE is a block-like statement specially from
* JSCS#disallowPaddingNewLinesAfterBl... | javascript | function isBlockLikeStatement(sourceCode, node) {
// do-while with a block is a block-like statement.
if (node.type === "DoWhileStatement" && node.body.type === "BlockStatement") {
return true;
}
/*
* IIFE is a block-like statement specially from
* JSCS#disallowPaddingNewLinesAfterBl... | [
"function",
"isBlockLikeStatement",
"(",
"sourceCode",
",",
"node",
")",
"{",
"// do-while with a block is a block-like statement.",
"if",
"(",
"node",
".",
"type",
"===",
"\"DoWhileStatement\"",
"&&",
"node",
".",
"body",
".",
"type",
"===",
"\"BlockStatement\"",
")"... | Checks whether the given node is a block-like statement.
This checks the last token of the node is the closing brace of a block.
@param {SourceCode} sourceCode The source code to get tokens.
@param {ASTNode} node The node to check.
@returns {boolean} `true` if the node is a block-like statement.
@private | [
"Checks",
"whether",
"the",
"given",
"node",
"is",
"a",
"block",
"-",
"like",
"statement",
".",
"This",
"checks",
"the",
"last",
"token",
"of",
"the",
"node",
"is",
"the",
"closing",
"brace",
"of",
"a",
"block",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/padding-line-between-statements.js#L112-L137 | train | Checks whether a given node is a block - like statement. | [
30522,
3853,
2003,
23467,
10359,
9153,
18532,
30524,
1000,
1004,
1004,
13045,
1012,
2303,
1012,
2828,
1027,
1027,
1027,
1000,
5991,
12259,
3672,
1000,
1007,
1063,
2709,
2995,
1025,
1065,
1013,
1008,
1008,
2462,
7959,
2003,
1037,
3796,
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/search/FileFilters.js | _doPopulate | function _doPopulate() {
var dropdownItems = [Strings.NEW_FILE_FILTER, Strings.CLEAR_FILE_FILTER],
filterSets = PreferencesManager.get("fileFilters") || [];
if (filterSets.length) {
dropdownItems.push("---");
// Remove all the empty exclusion sets before concatenati... | javascript | function _doPopulate() {
var dropdownItems = [Strings.NEW_FILE_FILTER, Strings.CLEAR_FILE_FILTER],
filterSets = PreferencesManager.get("fileFilters") || [];
if (filterSets.length) {
dropdownItems.push("---");
// Remove all the empty exclusion sets before concatenati... | [
"function",
"_doPopulate",
"(",
")",
"{",
"var",
"dropdownItems",
"=",
"[",
"Strings",
".",
"NEW_FILE_FILTER",
",",
"Strings",
".",
"CLEAR_FILE_FILTER",
"]",
",",
"filterSets",
"=",
"PreferencesManager",
".",
"get",
"(",
"\"fileFilters\"",
")",
"||",
"[",
"]",... | Populate the list of dropdown menu with two filter commands and
the list of saved filter sets. | [
"Populate",
"the",
"list",
"of",
"dropdown",
"menu",
"with",
"two",
"filter",
"commands",
"and",
"the",
"list",
"of",
"saved",
"filter",
"sets",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FileFilters.js#L91-L108 | train | Populate the file filter dropdown | [
30522,
3853,
1035,
2079,
16340,
9869,
1006,
1007,
1063,
13075,
4530,
7698,
4221,
5244,
1027,
1031,
7817,
1012,
2047,
1035,
5371,
1035,
11307,
1010,
7817,
1012,
3154,
1035,
5371,
1035,
11307,
1033,
1010,
17736,
8454,
1027,
18394,
24805,
4590... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/common/utils.js | assign | function assign(obj /*from1, from2, from3, ...*/) {
var sources = Array.prototype.slice.call(arguments, 1);
sources.forEach(function (source) {
if (!source) { return; }
if (typeof source !== 'object') {
throw new TypeError(source + 'must be object');
}
Object.keys(source).forEach(function (... | javascript | function assign(obj /*from1, from2, from3, ...*/) {
var sources = Array.prototype.slice.call(arguments, 1);
sources.forEach(function (source) {
if (!source) { return; }
if (typeof source !== 'object') {
throw new TypeError(source + 'must be object');
}
Object.keys(source).forEach(function (... | [
"function",
"assign",
"(",
"obj",
"/*from1, from2, from3, ...*/",
")",
"{",
"var",
"sources",
"=",
"Array",
".",
"prototype",
".",
"slice",
".",
"call",
"(",
"arguments",
",",
"1",
")",
";",
"sources",
".",
"forEach",
"(",
"function",
"(",
"source",
")",
... | Merge objects | [
"Merge",
"objects"
] | ba6830ba13fb92953a91fb90318964ccd15b82c4 | https://github.com/markdown-it/markdown-it/blob/ba6830ba13fb92953a91fb90318964ccd15b82c4/lib/common/utils.js#L18-L34 | train | Assign all the specified objects to obj. | [
30522,
3853,
23911,
1006,
27885,
3501,
1013,
1008,
2013,
2487,
1010,
2013,
30524,
18921,
6776,
1006,
3853,
1006,
3120,
1007,
1063,
2065,
1006,
999,
3120,
1007,
1063,
2709,
1025,
1065,
2065,
1006,
2828,
11253,
3120,
999,
1027,
1027,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js | function (oData, aPath) {
return aPath.reduce(function (oData, sSegment) {
return (oData && sSegment in oData) ? oData[sSegment] : undefined;
}, oData);
} | javascript | function (oData, aPath) {
return aPath.reduce(function (oData, sSegment) {
return (oData && sSegment in oData) ? oData[sSegment] : undefined;
}, oData);
} | [
"function",
"(",
"oData",
",",
"aPath",
")",
"{",
"return",
"aPath",
".",
"reduce",
"(",
"function",
"(",
"oData",
",",
"sSegment",
")",
"{",
"return",
"(",
"oData",
"&&",
"sSegment",
"in",
"oData",
")",
"?",
"oData",
"[",
"sSegment",
"]",
":",
"unde... | Drills down into the given object according to <code>aPath</code>.
@param {object} oData
The object to start at
@param {string[]} aPath
Relative path to drill-down into, as array of segments
@returns {*}
The result matching to <code>aPath</code> or <code>undefined</code> if the path leads
into void | [
"Drills",
"down",
"into",
"the",
"given",
"object",
"according",
"to",
"<code",
">",
"aPath<",
"/",
"code",
">",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js#L347-L351 | train | Returns the value of the key in the given path | [
30522,
3853,
1006,
1051,
2850,
2696,
1010,
9706,
8988,
1007,
1063,
2709,
9706,
8988,
1012,
5547,
1006,
3853,
1006,
1051,
2850,
2696,
1010,
7020,
13910,
3672,
1007,
1063,
2709,
1006,
1051,
2850,
2696,
1004,
1004,
7020,
13910,
3672,
1999,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
ColorlibHQ/AdminLTE | plugins/timepicker/bootstrap-timepicker.js | function (segment, step) {
if (segment % step === 0) {
return segment;
}
if (Math.round((segment % step) / step)) {
return (segment + (step - segment % step)) % 60;
} else {
return segment - segment % step;
}
} | javascript | function (segment, step) {
if (segment % step === 0) {
return segment;
}
if (Math.round((segment % step) / step)) {
return (segment + (step - segment % step)) % 60;
} else {
return segment - segment % step;
}
} | [
"function",
"(",
"segment",
",",
"step",
")",
"{",
"if",
"(",
"segment",
"%",
"step",
"===",
"0",
")",
"{",
"return",
"segment",
";",
"}",
"if",
"(",
"Math",
".",
"round",
"(",
"(",
"segment",
"%",
"step",
")",
"/",
"step",
")",
")",
"{",
"retu... | Given a segment value like 43, will round and snap the segment
to the nearest "step", like 45 if step is 15. Segment will
"overflow" to 0 if it's larger than 59 or would otherwise
round up to 60. | [
"Given",
"a",
"segment",
"value",
"like",
"43",
"will",
"round",
"and",
"snap",
"the",
"segment",
"to",
"the",
"nearest",
"step",
"like",
"45",
"if",
"step",
"is",
"15",
".",
"Segment",
"will",
"overflow",
"to",
"0",
"if",
"it",
"s",
"larger",
"than",
... | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/timepicker/bootstrap-timepicker.js#L647-L656 | train | Calculate the next segment | [
30522,
3853,
1006,
6903,
1010,
3357,
1007,
1063,
2065,
1006,
6903,
1003,
3357,
1027,
1027,
1027,
1014,
1007,
1063,
2709,
6903,
1025,
1065,
2065,
30524,
1006,
3357,
1011,
6903,
1003,
3357,
1007,
1007,
1003,
3438,
1025,
1065,
2842,
1063,
27... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/SearchResultsView.js | SearchResultsView | function SearchResultsView(model, panelID, panelName, type) {
var panelHtml = Mustache.render(searchPanelTemplate, {panelID: panelID});
this._panel = WorkspaceManager.createBottomPanel(panelName, $(panelHtml), 100);
this._$summary = this._panel.$panel.find(".title");
this._$table ... | javascript | function SearchResultsView(model, panelID, panelName, type) {
var panelHtml = Mustache.render(searchPanelTemplate, {panelID: panelID});
this._panel = WorkspaceManager.createBottomPanel(panelName, $(panelHtml), 100);
this._$summary = this._panel.$panel.find(".title");
this._$table ... | [
"function",
"SearchResultsView",
"(",
"model",
",",
"panelID",
",",
"panelName",
",",
"type",
")",
"{",
"var",
"panelHtml",
"=",
"Mustache",
".",
"render",
"(",
"searchPanelTemplate",
",",
"{",
"panelID",
":",
"panelID",
"}",
")",
";",
"this",
".",
"_panel... | @constructor
Handles the search results panel.
Dispatches the following events:
replaceBatch - when the "Replace" button is clicked.
close - when the panel is closed.
@param {SearchModel} model The model that this view is showing.
@param {string} panelID The CSS ID to use for the panel.
@param {string} panelName The n... | [
"@constructor",
"Handles",
"the",
"search",
"results",
"panel",
".",
"Dispatches",
"the",
"following",
"events",
":",
"replaceBatch",
"-",
"when",
"the",
"Replace",
"button",
"is",
"clicked",
".",
"close",
"-",
"when",
"the",
"panel",
"is",
"closed",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/SearchResultsView.js#L77-L85 | train | Search results view | [
30522,
3853,
3945,
6072,
11314,
2015,
8584,
1006,
2944,
1010,
5997,
3593,
1010,
5997,
18442,
1010,
2828,
1007,
1063,
13075,
5997,
11039,
19968,
1027,
28786,
1012,
17552,
1006,
3945,
9739,
20042,
6633,
15725,
1010,
1063,
5997,
3593,
1024,
59... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
TryGhost/Ghost | core/server/adapters/storage/index.js | getStorage | function getStorage() {
const storageChoice = config.get('storage:active');
let storageConfig,
CustomStorage,
customStorage;
storageConfig = config.get('storage')[storageChoice];
// CASE: type does not exist
if (!storageChoice) {
throw new common.errors.IncorrectUsageError(... | javascript | function getStorage() {
const storageChoice = config.get('storage:active');
let storageConfig,
CustomStorage,
customStorage;
storageConfig = config.get('storage')[storageChoice];
// CASE: type does not exist
if (!storageChoice) {
throw new common.errors.IncorrectUsageError(... | [
"function",
"getStorage",
"(",
")",
"{",
"const",
"storageChoice",
"=",
"config",
".",
"get",
"(",
"'storage:active'",
")",
";",
"let",
"storageConfig",
",",
"CustomStorage",
",",
"customStorage",
";",
"storageConfig",
"=",
"config",
".",
"get",
"(",
"'storage... | type: images | [
"type",
":",
"images"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/adapters/storage/index.js#L10-L95 | train | Get the storage adapter | [
30522,
3853,
4152,
4263,
4270,
1006,
1007,
1063,
9530,
3367,
5527,
9905,
6610,
1027,
30524,
1031,
5527,
9905,
6610,
1033,
1025,
1013,
1013,
2553,
1024,
2828,
2515,
2025,
4839,
2065,
1006,
999,
5527,
9905,
6610,
1007,
1063,
5466,
2047,
269... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/LiveDevelopment/Agents/RemoteAgent.js | load | function load() {
_load = new $.Deferred();
Inspector.Page.on("frameNavigated.RemoteAgent", _onFrameNavigated);
Inspector.Page.on("frameStartedLoading.RemoteAgent", _stopKeepAliveInterval);
Inspector.DOM.on("attributeModified.RemoteAgent", _onAttributeModified);
return _load.pro... | javascript | function load() {
_load = new $.Deferred();
Inspector.Page.on("frameNavigated.RemoteAgent", _onFrameNavigated);
Inspector.Page.on("frameStartedLoading.RemoteAgent", _stopKeepAliveInterval);
Inspector.DOM.on("attributeModified.RemoteAgent", _onAttributeModified);
return _load.pro... | [
"function",
"load",
"(",
")",
"{",
"_load",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"Inspector",
".",
"Page",
".",
"on",
"(",
"\"frameNavigated.RemoteAgent\"",
",",
"_onFrameNavigated",
")",
";",
"Inspector",
".",
"Page",
".",
"on",
"(",
"\"fram... | Initialize the agent | [
"Initialize",
"the",
"agent"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/RemoteAgent.js#L149-L156 | train | Load the language code | [
30522,
3853,
7170,
1006,
1007,
1063,
1035,
7170,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1025,
7742,
1012,
3931,
1012,
2006,
1006,
1000,
4853,
2532,
5737,
11644,
1012,
6556,
4270,
3372,
1000,
1010,
1035,
2006,
15643,
2532,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/radio/radio.js | function(stations) {
var self = this;
self.stations = stations;
self.index = 0;
// Setup the display for each station.
for (var i=0; i<self.stations.length; i++) {
window['title' + i].innerHTML = '<b>' + self.stations[i].freq + '</b> ' + self.stations[i].title;
window['station' + i].addEventListen... | javascript | function(stations) {
var self = this;
self.stations = stations;
self.index = 0;
// Setup the display for each station.
for (var i=0; i<self.stations.length; i++) {
window['title' + i].innerHTML = '<b>' + self.stations[i].freq + '</b> ' + self.stations[i].title;
window['station' + i].addEventListen... | [
"function",
"(",
"stations",
")",
"{",
"var",
"self",
"=",
"this",
";",
"self",
".",
"stations",
"=",
"stations",
";",
"self",
".",
"index",
"=",
"0",
";",
"// Setup the display for each station.",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"self... | Radio class containing the state of our stations.
Includes all methods for playing, stopping, etc.
@param {Array} stations Array of objects with station details ({title, src, howl, ...}). | [
"Radio",
"class",
"containing",
"the",
"state",
"of",
"our",
"stations",
".",
"Includes",
"all",
"methods",
"for",
"playing",
"stopping",
"etc",
"."
] | 030db918dd8ce640afd57e172418472497e8f113 | https://github.com/goldfire/howler.js/blob/030db918dd8ce640afd57e172418472497e8f113/examples/radio/radio.js#L22-L43 | train | This function is called by the station class to display the station s sounds. | [
30522,
3853,
1006,
3703,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
2969,
1012,
3703,
1027,
3703,
1025,
2969,
1012,
5950,
1027,
1014,
1025,
1013,
1013,
16437,
1996,
4653,
2005,
2169,
2276,
1012,
2005,
1006,
13075,
1045,
1027,
1014,
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/project/FileTreeView.js | function (event) {
if (this.props.entry.get("rename")) {
event.stopPropagation();
return;
}
if (event.button !== LEFT_MOUSE_BUTTON) {
return;
}
var isOpen = this.props.entry.get("open"),
setOpen... | javascript | function (event) {
if (this.props.entry.get("rename")) {
event.stopPropagation();
return;
}
if (event.button !== LEFT_MOUSE_BUTTON) {
return;
}
var isOpen = this.props.entry.get("open"),
setOpen... | [
"function",
"(",
"event",
")",
"{",
"if",
"(",
"this",
".",
"props",
".",
"entry",
".",
"get",
"(",
"\"rename\"",
")",
")",
"{",
"event",
".",
"stopPropagation",
"(",
")",
";",
"return",
";",
"}",
"if",
"(",
"event",
".",
"button",
"!==",
"LEFT_MOU... | If you click on a directory, it will toggle between open and closed. | [
"If",
"you",
"click",
"on",
"a",
"directory",
"it",
"will",
"toggle",
"between",
"open",
"and",
"closed",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L785-L821 | train | on keydown | [
30522,
3853,
1006,
2724,
1007,
1063,
2065,
1006,
2023,
1012,
24387,
1012,
4443,
1012,
2131,
1006,
1000,
14916,
14074,
1000,
1007,
1007,
1063,
2724,
1012,
2644,
21572,
4502,
12540,
1006,
1007,
1025,
2709,
1025,
1065,
2065,
1006,
2724,
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... | |
Freeboard/freeboard | examples/plugin_example.js | function(settings)
{
var self = this;
var currentSettings = settings;
// Here we create an element to hold the text we're going to display. We're going to set the value displayed in it below.
var myTextElement = $("<span></span>");
// **render(containerElement)** (required) : A public function we must impl... | javascript | function(settings)
{
var self = this;
var currentSettings = settings;
// Here we create an element to hold the text we're going to display. We're going to set the value displayed in it below.
var myTextElement = $("<span></span>");
// **render(containerElement)** (required) : A public function we must impl... | [
"function",
"(",
"settings",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"currentSettings",
"=",
"settings",
";",
"// Here we create an element to hold the text we're going to display. We're going to set the value displayed in it below.",
"var",
"myTextElement",
"=",
"$",... | ### Widget Implementation ------------------- Here we implement the actual widget plugin. We pass in the settings; | [
"###",
"Widget",
"Implementation",
"-------------------",
"Here",
"we",
"implement",
"the",
"actual",
"widget",
"plugin",
".",
"We",
"pass",
"in",
"the",
"settings",
";"
] | 38789f6e8bd3d04f7d3b2c3427e509d00f2610fc | https://github.com/Freeboard/freeboard/blob/38789f6e8bd3d04f7d3b2c3427e509d00f2610fc/examples/plugin_example.js#L243-L297 | train | This is the main function that will be called when the user sets the value of the widget. | [
30522,
3853,
1006,
10906,
1007,
1063,
13075,
2969,
1027,
2023,
1025,
13075,
14731,
18319,
3070,
2015,
1027,
10906,
1025,
1013,
1013,
2182,
2057,
3443,
2019,
5783,
2000,
2907,
1996,
3793,
2057,
1005,
2128,
2183,
2000,
4653,
1012,
2057,
1005,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
angular/material | src/components/tabs/js/tabsController.js | handleSelectedIndexChange | function handleSelectedIndexChange (newValue, oldValue) {
if (newValue === oldValue) return;
ctrl.selectedIndex = getNearestSafeIndex(newValue);
ctrl.lastSelectedIndex = oldValue;
ctrl.updateInkBarStyles();
updateHeightFromContent();
adjustOffset(newValue);
$scope.$broadcast('$mdTabsCha... | javascript | function handleSelectedIndexChange (newValue, oldValue) {
if (newValue === oldValue) return;
ctrl.selectedIndex = getNearestSafeIndex(newValue);
ctrl.lastSelectedIndex = oldValue;
ctrl.updateInkBarStyles();
updateHeightFromContent();
adjustOffset(newValue);
$scope.$broadcast('$mdTabsCha... | [
"function",
"handleSelectedIndexChange",
"(",
"newValue",
",",
"oldValue",
")",
"{",
"if",
"(",
"newValue",
"===",
"oldValue",
")",
"return",
";",
"ctrl",
".",
"selectedIndex",
"=",
"getNearestSafeIndex",
"(",
"newValue",
")",
";",
"ctrl",
".",
"lastSelectedInde... | Update the UI whenever the selected index changes. Calls user-defined select/deselect methods.
@param {number} newValue selected index's new value
@param {number} oldValue selected index's previous value | [
"Update",
"the",
"UI",
"whenever",
"the",
"selected",
"index",
"changes",
".",
"Calls",
"user",
"-",
"defined",
"select",
"/",
"deselect",
"methods",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/tabs/js/tabsController.js#L260-L271 | train | Handle the selection of a tab. | [
30522,
3853,
16024,
12260,
10985,
22254,
10288,
22305,
2063,
1006,
2047,
10175,
5657,
1010,
2214,
10175,
5657,
1007,
1063,
2065,
1006,
2047,
10175,
5657,
1027,
1027,
1027,
2214,
10175,
5657,
1007,
2709,
1025,
14931,
12190,
1012,
3479,
22254,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TablePointerExtension.js | function(oTable, oEvent) {
var $Body = jQuery(document.body),
$Splitter = oTable.$("sb"),
$Document = jQuery(document),
offset = $Splitter.offset(),
height = $Splitter.height(),
width = $Splitter.width(),
bTouch = oTable._isTouchEvent(oEvent);
// Fix for IE text selection while dragging
... | javascript | function(oTable, oEvent) {
var $Body = jQuery(document.body),
$Splitter = oTable.$("sb"),
$Document = jQuery(document),
offset = $Splitter.offset(),
height = $Splitter.height(),
width = $Splitter.width(),
bTouch = oTable._isTouchEvent(oEvent);
// Fix for IE text selection while dragging
... | [
"function",
"(",
"oTable",
",",
"oEvent",
")",
"{",
"var",
"$Body",
"=",
"jQuery",
"(",
"document",
".",
"body",
")",
",",
"$Splitter",
"=",
"oTable",
".",
"$",
"(",
"\"sb\"",
")",
",",
"$Document",
"=",
"jQuery",
"(",
"document",
")",
",",
"offset",... | /*
Initializes the drag&drop for resizing | [
"/",
"*",
"Initializes",
"the",
"drag&drop",
"for",
"resizing"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TablePointerExtension.js#L367-L394 | train | Handles mouseup and touchend events on the table | [
30522,
3853,
1006,
27178,
3085,
1010,
1051,
18697,
3372,
1007,
1063,
13075,
1002,
2303,
1027,
1046,
4226,
2854,
1006,
6254,
1012,
2303,
1007,
1010,
1002,
3975,
3334,
1027,
27178,
3085,
1012,
1002,
1006,
1000,
30524,
1027,
27178,
3085,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
ColorlibHQ/AdminLTE | plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js | function(method, restoreScrollPosition) {
var win = this.doc.defaultView || this.doc.parentWindow,
sel = rangy.saveSelection(win);
if (!sel) {
method();
} else {
try {
method();
} catch(e) {
setTimeout(function() { throw e; }, 0);
}
... | javascript | function(method, restoreScrollPosition) {
var win = this.doc.defaultView || this.doc.parentWindow,
sel = rangy.saveSelection(win);
if (!sel) {
method();
} else {
try {
method();
} catch(e) {
setTimeout(function() { throw e; }, 0);
}
... | [
"function",
"(",
"method",
",",
"restoreScrollPosition",
")",
"{",
"var",
"win",
"=",
"this",
".",
"doc",
".",
"defaultView",
"||",
"this",
".",
"doc",
".",
"parentWindow",
",",
"sel",
"=",
"rangy",
".",
"saveSelection",
"(",
"win",
")",
";",
"if",
"("... | TODO: Figure out a method from following 2 that would work universally | [
"TODO",
":",
"Figure",
"out",
"a",
"method",
"from",
"following",
"2",
"that",
"would",
"work",
"universally"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L9051-L9065 | train | This method is a helper function that will call the method with the current selection and the scroll position of the document. | [
30522,
3853,
1006,
4118,
1010,
9239,
11020,
28402,
26994,
1007,
1063,
13075,
2663,
1027,
2023,
1012,
9986,
1012,
12398,
8584,
1064,
1064,
2023,
1012,
9986,
1012,
6687,
11101,
5004,
1010,
7367,
2140,
1027,
8369,
2100,
1012,
13169,
12260,
754... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/traverser.js | getVisitorKeys | function getVisitorKeys(visitorKeys, node) {
let keys = visitorKeys[node.type];
if (!keys) {
keys = vk.getKeys(node);
debug("Unknown node type \"%s\": Estimated visitor keys %j", node.type, keys);
}
return keys;
} | javascript | function getVisitorKeys(visitorKeys, node) {
let keys = visitorKeys[node.type];
if (!keys) {
keys = vk.getKeys(node);
debug("Unknown node type \"%s\": Estimated visitor keys %j", node.type, keys);
}
return keys;
} | [
"function",
"getVisitorKeys",
"(",
"visitorKeys",
",",
"node",
")",
"{",
"let",
"keys",
"=",
"visitorKeys",
"[",
"node",
".",
"type",
"]",
";",
"if",
"(",
"!",
"keys",
")",
"{",
"keys",
"=",
"vk",
".",
"getKeys",
"(",
"node",
")",
";",
"debug",
"("... | Get the visitor keys of a given node.
@param {Object} visitorKeys The map of visitor keys.
@param {ASTNode} node The node to get their visitor keys.
@returns {string[]} The visitor keys of the node. | [
"Get",
"the",
"visitor",
"keys",
"of",
"a",
"given",
"node",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/util/traverser.js#L43-L52 | train | Get the visitor keys for a node | [
30522,
3853,
2131,
11365,
15660,
14839,
2015,
1006,
10367,
14839,
2015,
1010,
13045,
1007,
1063,
2292,
6309,
1027,
10367,
14839,
2015,
1031,
13045,
1012,
2828,
1033,
1025,
2065,
1006,
999,
6309,
1007,
1063,
6309,
1027,
1058,
2243,
1012,
213... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/StaticServer/node/StaticServerDomain.js | _cmdWriteFilteredResponse | function _cmdWriteFilteredResponse(root, path, resData) {
var pathKey = getPathKey(root),
callback = _requests[pathKey][resData.id];
if (callback) {
callback(resData);
} else {
console.warn("writeFilteredResponse: Missing callback for %s. This command must only be called after a re... | javascript | function _cmdWriteFilteredResponse(root, path, resData) {
var pathKey = getPathKey(root),
callback = _requests[pathKey][resData.id];
if (callback) {
callback(resData);
} else {
console.warn("writeFilteredResponse: Missing callback for %s. This command must only be called after a re... | [
"function",
"_cmdWriteFilteredResponse",
"(",
"root",
",",
"path",
",",
"resData",
")",
"{",
"var",
"pathKey",
"=",
"getPathKey",
"(",
"root",
")",
",",
"callback",
"=",
"_requests",
"[",
"pathKey",
"]",
"[",
"resData",
".",
"id",
"]",
";",
"if",
"(",
... | @private
Overrides the server response from static middleware with the provided
response data. This should be called only in response to a filtered request.
@param {string} path The absolute path of the server
@param {string} root The relative path of the file beginning with a forward slash "/"
@param {!Object} resDat... | [
"@private",
"Overrides",
"the",
"server",
"response",
"from",
"static",
"middleware",
"with",
"the",
"provided",
"response",
"data",
".",
"This",
"should",
"be",
"called",
"only",
"in",
"response",
"to",
"a",
"filtered",
"request",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/StaticServer/node/StaticServerDomain.js#L334-L343 | train | Called when a requestFilter event is fired for a path. | [
30522,
3853,
1035,
4642,
2094,
26373,
8873,
21928,
2098,
6072,
26029,
3366,
1006,
7117,
1010,
4130,
1010,
24501,
2850,
2696,
1007,
1063,
13075,
4130,
14839,
1027,
2131,
15069,
14839,
1006,
7117,
1007,
1010,
2655,
5963,
1027,
1035,
11186,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aframevr/aframe | src/systems/geometry.js | createGeometry | function createGeometry (data) {
var geometryType = data.primitive;
var GeometryClass = geometries[geometryType] && geometries[geometryType].Geometry;
var geometryInstance = new GeometryClass();
if (!GeometryClass) { throw new Error('Unknown geometry `' + geometryType + '`'); }
geometryInstance.init(data);
... | javascript | function createGeometry (data) {
var geometryType = data.primitive;
var GeometryClass = geometries[geometryType] && geometries[geometryType].Geometry;
var geometryInstance = new GeometryClass();
if (!GeometryClass) { throw new Error('Unknown geometry `' + geometryType + '`'); }
geometryInstance.init(data);
... | [
"function",
"createGeometry",
"(",
"data",
")",
"{",
"var",
"geometryType",
"=",
"data",
".",
"primitive",
";",
"var",
"GeometryClass",
"=",
"geometries",
"[",
"geometryType",
"]",
"&&",
"geometries",
"[",
"geometryType",
"]",
".",
"Geometry",
";",
"var",
"g... | Create geometry using component data.
@param {object} data - Component data.
@returns {object} Geometry. | [
"Create",
"geometry",
"using",
"component",
"data",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/systems/geometry.js#L98-L107 | train | Create geometry from data | [
30522,
3853,
3443,
3351,
8462,
11129,
1006,
2951,
1007,
1063,
13075,
10988,
13874,
1027,
2951,
1012,
10968,
1025,
13075,
10988,
26266,
1027,
20248,
11368,
5134,
1031,
10988,
13874,
1033,
1004,
1004,
20248,
11368,
5134,
1031,
10988,
13874,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js | function (mAggregate) {
return !!mAggregate && Object.keys(mAggregate).some(function (sAlias) {
var oDetails = mAggregate[sAlias];
return oDetails.min || oDetails.max;
});
} | javascript | function (mAggregate) {
return !!mAggregate && Object.keys(mAggregate).some(function (sAlias) {
var oDetails = mAggregate[sAlias];
return oDetails.min || oDetails.max;
});
} | [
"function",
"(",
"mAggregate",
")",
"{",
"return",
"!",
"!",
"mAggregate",
"&&",
"Object",
".",
"keys",
"(",
"mAggregate",
")",
".",
"some",
"(",
"function",
"(",
"sAlias",
")",
"{",
"var",
"oDetails",
"=",
"mAggregate",
"[",
"sAlias",
"]",
";",
"retur... | Tells whether minimum or maximum values are needed for at least one aggregatable
property.
@param {object} [mAggregate]
A map from aggregatable property names or aliases to details objects
@returns {boolean}
Whether minimum or maximum values are needed for at least one aggregatable
property.
@public | [
"Tells",
"whether",
"minimum",
"or",
"maximum",
"values",
"are",
"needed",
"for",
"at",
"least",
"one",
"aggregatable",
"property",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js#L369-L375 | train | Returns true if the aggregate has a min or max property | [
30522,
3853,
1006,
23848,
17603,
5867,
1007,
1063,
2709,
999,
999,
23848,
17603,
5867,
1004,
1004,
4874,
1012,
6309,
1006,
23848,
17603,
5867,
1007,
1012,
2070,
1006,
3853,
1006,
16183,
7951,
1007,
1063,
13075,
24040,
22081,
1027,
23848,
17... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/RequestRecorder.js | function(filename, options) {
_private.oLog.info(sModuleName + " - Record");
if (window.XMLHttpRequest.name === 'FakeXMLHttpRequest') {
_private.oLog.warning(sModuleName + " - Sinon FakeXMLHttpRequest is enabled by another application, recording could be defective");
}
if (_private.isRecordStarted()) {
... | javascript | function(filename, options) {
_private.oLog.info(sModuleName + " - Record");
if (window.XMLHttpRequest.name === 'FakeXMLHttpRequest') {
_private.oLog.warning(sModuleName + " - Sinon FakeXMLHttpRequest is enabled by another application, recording could be defective");
}
if (_private.isRecordStarted()) {
... | [
"function",
"(",
"filename",
",",
"options",
")",
"{",
"_private",
".",
"oLog",
".",
"info",
"(",
"sModuleName",
"+",
"\" - Record\"",
")",
";",
"if",
"(",
"window",
".",
"XMLHttpRequest",
".",
"name",
"===",
"'FakeXMLHttpRequest'",
")",
"{",
"_private",
"... | Start recording with a desired filename and the required options.
@param {string|object} filename The name of the har file to be recorded.
@param {object} [options] Contains optional parameters to config the RequestRecorder:
{function} [options.customGroupNameCallback] A callback is used to determine the custom groupn... | [
"Start",
"recording",
"with",
"a",
"desired",
"filename",
"and",
"the",
"required",
"options",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/RequestRecorder.js#L569-L628 | train | record the request | [
30522,
3853,
1006,
5371,
18442,
1010,
7047,
1007,
1063,
1035,
2797,
1012,
19330,
8649,
1012,
18558,
1006,
15488,
7716,
9307,
18442,
1009,
1000,
1011,
2501,
1000,
1007,
1025,
2065,
1006,
3332,
1012,
20950,
11039,
25856,
2890,
15500,
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.table/src/sap/ui/table/TableUtils.js | function(oTable) {
if (oTable._iHeaderRowCount === undefined) {
if (!oTable.getColumnHeaderVisible()) {
oTable._iHeaderRowCount = 0;
} else {
var iHeaderRows = 1;
var aColumns = oTable.getColumns();
for (var i = 0; i < aColumns.length; i++) {
if (aColumns[i].shouldRender()) {
... | javascript | function(oTable) {
if (oTable._iHeaderRowCount === undefined) {
if (!oTable.getColumnHeaderVisible()) {
oTable._iHeaderRowCount = 0;
} else {
var iHeaderRows = 1;
var aColumns = oTable.getColumns();
for (var i = 0; i < aColumns.length; i++) {
if (aColumns[i].shouldRender()) {
... | [
"function",
"(",
"oTable",
")",
"{",
"if",
"(",
"oTable",
".",
"_iHeaderRowCount",
"===",
"undefined",
")",
"{",
"if",
"(",
"!",
"oTable",
".",
"getColumnHeaderVisible",
"(",
")",
")",
"{",
"oTable",
".",
"_iHeaderRowCount",
"=",
"0",
";",
"}",
"else",
... | Returns the number of header rows.
@param {sap.ui.table.Table} oTable Instance of the table.
@returns {int} The number of rows in the table header. | [
"Returns",
"the",
"number",
"of",
"header",
"rows",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableUtils.js#L558-L577 | train | Returns the number of rows in the header of the table. | [
30522,
3853,
1006,
27178,
3085,
1007,
1063,
2065,
1006,
27178,
3085,
1012,
1035,
1045,
4974,
2121,
10524,
3597,
16671,
1027,
1027,
1027,
6151,
28344,
1007,
1063,
2065,
1006,
999,
27178,
3085,
1012,
2131,
25778,
2819,
25311,
13775,
2121,
113... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/thirdparty/blanket.js | parseVariableIdentifier | function parseVariableIdentifier() {
var token, startToken;
startToken = lookahead;
token = lex();
if (token.type !== Token.Identifier) {
throwUnexpected(token);
}
return delegate.markEnd(delegate.createIdentifier(token.value), startToken);
} | javascript | function parseVariableIdentifier() {
var token, startToken;
startToken = lookahead;
token = lex();
if (token.type !== Token.Identifier) {
throwUnexpected(token);
}
return delegate.markEnd(delegate.createIdentifier(token.value), startToken);
} | [
"function",
"parseVariableIdentifier",
"(",
")",
"{",
"var",
"token",
",",
"startToken",
";",
"startToken",
"=",
"lookahead",
";",
"token",
"=",
"lex",
"(",
")",
";",
"if",
"(",
"token",
".",
"type",
"!==",
"Token",
".",
"Identifier",
")",
"{",
"throwUne... | 12.2 Variable Statement | [
"12",
".",
"2",
"Variable",
"Statement"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/thirdparty/blanket.js#L2643-L2654 | train | ECMA - 262 12. 2 The identifier | [
30522,
3853,
11968,
3366,
10755,
19210,
5178,
16778,
8873,
2121,
1006,
1007,
1063,
13075,
19204,
1010,
2707,
18715,
2368,
1025,
2707,
18715,
2368,
1027,
2298,
4430,
13775,
1025,
19204,
1027,
17244,
1006,
1007,
1025,
2065,
1006,
19204,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/AutoUpdate/main.js | setUpdateStateInJSON | function setUpdateStateInJSON(key, value) {
var result = $.Deferred();
updateJsonHandler.set(key, value)
.done(function () {
result.resolve();
})
.fail(function () {
resetStateInFailure("AutoUpdate : Could not modify updatehelper.json... | javascript | function setUpdateStateInJSON(key, value) {
var result = $.Deferred();
updateJsonHandler.set(key, value)
.done(function () {
result.resolve();
})
.fail(function () {
resetStateInFailure("AutoUpdate : Could not modify updatehelper.json... | [
"function",
"setUpdateStateInJSON",
"(",
"key",
",",
"value",
")",
"{",
"var",
"result",
"=",
"$",
".",
"Deferred",
"(",
")",
";",
"updateJsonHandler",
".",
"set",
"(",
"key",
",",
"value",
")",
".",
"done",
"(",
"function",
"(",
")",
"{",
"result",
... | Sets the update state in updateHelper.json in Appdata
@param {string} key - key to be set
@param {string} value - value to be set
@returns {$.Deferred} - a jquery promise, that is resolved with
success or failure of state update in json file | [
"Sets",
"the",
"update",
"state",
"in",
"updateHelper",
".",
"json",
"in",
"Appdata"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L632-L644 | train | set update state in updatehelper. json | [
30522,
3853,
16437,
27122,
12259,
2378,
22578,
2239,
1006,
3145,
1010,
3643,
1007,
1063,
13075,
2765,
1027,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1025,
10651,
22578,
2239,
11774,
3917,
1012,
30524,
4842,
1012,
1046,
3385,
1000,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/util/IndexWorker.js | getObjectValues | function getObjectValues(oObject) {
var aKeys = Object.keys(oObject),
aValues = [];
aKeys.forEach(function(sKey) {
aValues.push(oObject[sKey]);
});
return aValues;
} | javascript | function getObjectValues(oObject) {
var aKeys = Object.keys(oObject),
aValues = [];
aKeys.forEach(function(sKey) {
aValues.push(oObject[sKey]);
});
return aValues;
} | [
"function",
"getObjectValues",
"(",
"oObject",
")",
"{",
"var",
"aKeys",
"=",
"Object",
".",
"keys",
"(",
"oObject",
")",
",",
"aValues",
"=",
"[",
"]",
";",
"aKeys",
".",
"forEach",
"(",
"function",
"(",
"sKey",
")",
"{",
"aValues",
".",
"push",
"("... | Polyfill for Object.values
as original Object.values is N/A on IE
@param oObject
@returns {Array} | [
"Polyfill",
"for",
"Object",
".",
"values"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/util/IndexWorker.js#L467-L476 | train | Get the values of an object | [
30522,
3853,
2131,
16429,
20614,
10175,
15808,
1006,
1051,
16429,
20614,
1007,
1063,
13075,
17712,
3240,
2015,
1027,
4874,
1012,
6309,
1006,
1051,
16429,
20614,
1007,
1010,
10927,
7630,
2229,
1027,
1031,
1033,
1025,
17712,
3240,
2015,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | build/js/BoxRefresh.js | Plugin | function Plugin(option) {
return this.each(function () {
var $this = $(this);
var data = $this.data(DataKey);
if (!data) {
var options = $.extend({}, Default, $this.data(), typeof option == 'object' && option);
$this.data(DataKey, (data = new BoxRefresh($this, options)));
}... | javascript | function Plugin(option) {
return this.each(function () {
var $this = $(this);
var data = $this.data(DataKey);
if (!data) {
var options = $.extend({}, Default, $this.data(), typeof option == 'object' && option);
$this.data(DataKey, (data = new BoxRefresh($this, options)));
}... | [
"function",
"Plugin",
"(",
"option",
")",
"{",
"return",
"this",
".",
"each",
"(",
"function",
"(",
")",
"{",
"var",
"$this",
"=",
"$",
"(",
"this",
")",
";",
"var",
"data",
"=",
"$this",
".",
"data",
"(",
"DataKey",
")",
";",
"if",
"(",
"!",
"... | Plugin Definition ================= | [
"Plugin",
"Definition",
"================="
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/build/js/BoxRefresh.js#L80-L97 | train | Plugin constructor. | [
30522,
3853,
13354,
2378,
1006,
5724,
1007,
1063,
2709,
2023,
1012,
2169,
1006,
3853,
1006,
1007,
1063,
13075,
1002,
2023,
1027,
1002,
1006,
2023,
1007,
1025,
13075,
2951,
1027,
1002,
2023,
1012,
2951,
1006,
2951,
14839,
1007,
1025,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/one-var.js | recordTypes | function recordTypes(statementType, declarations, currentScope) {
for (let i = 0; i < declarations.length; i++) {
if (declarations[i].init === null) {
if (options[statementType] && options[statementType].uninitialized === MODE_ALWAYS) {
currentScop... | javascript | function recordTypes(statementType, declarations, currentScope) {
for (let i = 0; i < declarations.length; i++) {
if (declarations[i].init === null) {
if (options[statementType] && options[statementType].uninitialized === MODE_ALWAYS) {
currentScop... | [
"function",
"recordTypes",
"(",
"statementType",
",",
"declarations",
",",
"currentScope",
")",
"{",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
"<",
"declarations",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"declarations",
"[",
"i",
"]",
"... | Records whether initialized/uninitialized/required variables are defined in current scope.
@param {string} statementType node.kind, one of: "var", "let", or "const"
@param {ASTNode[]} declarations List of declarations
@param {Object} currentScope The scope being investigated
@returns {void}
@private | [
"Records",
"whether",
"initialized",
"/",
"uninitialized",
"/",
"required",
"variables",
"are",
"defined",
"in",
"current",
"scope",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/one-var.js#L163-L179 | train | record types | [
30522,
3853,
2501,
13874,
2015,
1006,
4861,
13874,
1010,
8170,
2015,
1010,
14731,
16186,
1007,
1063,
2005,
1006,
2292,
1045,
1027,
1014,
1025,
1045,
1026,
8170,
2015,
1012,
3091,
1025,
1045,
1009,
1009,
1007,
1063,
2065,
1006,
8170,
2015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
eslint/eslint | lib/rules/semi.js | checkForSemicolonForVariableDeclaration | function checkForSemicolonForVariableDeclaration(node) {
const parent = node.parent;
if ((parent.type !== "ForStatement" || parent.init !== node) &&
(!/^For(?:In|Of)Statement/u.test(parent.type) || parent.left !== node)
) {
checkForSemicolon(node);
... | javascript | function checkForSemicolonForVariableDeclaration(node) {
const parent = node.parent;
if ((parent.type !== "ForStatement" || parent.init !== node) &&
(!/^For(?:In|Of)Statement/u.test(parent.type) || parent.left !== node)
) {
checkForSemicolon(node);
... | [
"function",
"checkForSemicolonForVariableDeclaration",
"(",
"node",
")",
"{",
"const",
"parent",
"=",
"node",
".",
"parent",
";",
"if",
"(",
"(",
"parent",
".",
"type",
"!==",
"\"ForStatement\"",
"||",
"parent",
".",
"init",
"!==",
"node",
")",
"&&",
"(",
... | Checks to see if there's a semicolon after a variable declaration.
@param {ASTNode} node The node to check.
@returns {void} | [
"Checks",
"to",
"see",
"if",
"there",
"s",
"a",
"semicolon",
"after",
"a",
"variable",
"declaration",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/semi.js#L290-L298 | train | Check if a semicolon is needed for a variable declaration | [
30522,
3853,
4638,
29278,
3366,
7712,
12898,
2078,
29278,
10755,
19210,
3207,
20464,
25879,
3258,
1006,
13045,
1007,
1063,
9530,
3367,
6687,
1027,
13045,
1012,
6687,
1025,
2065,
1006,
1006,
6687,
1012,
2828,
999,
1027,
1027,
1000,
2005,
915... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jiahaog/nativefier | src/build/iconBuild.js | iconBuild | function iconBuild(inpOptions, callback) {
const options = Object.assign({}, inpOptions);
const returnCallback = () => {
callback(null, options);
};
if (!options.icon) {
returnCallback();
return;
}
if (options.platform === 'win32') {
if (iconIsIco(options.icon)) {
returnCallback();
... | javascript | function iconBuild(inpOptions, callback) {
const options = Object.assign({}, inpOptions);
const returnCallback = () => {
callback(null, options);
};
if (!options.icon) {
returnCallback();
return;
}
if (options.platform === 'win32') {
if (iconIsIco(options.icon)) {
returnCallback();
... | [
"function",
"iconBuild",
"(",
"inpOptions",
",",
"callback",
")",
"{",
"const",
"options",
"=",
"Object",
".",
"assign",
"(",
"{",
"}",
",",
"inpOptions",
")",
";",
"const",
"returnCallback",
"=",
"(",
")",
"=>",
"{",
"callback",
"(",
"null",
",",
"opt... | @callback augmentIconsCallback
@param error
@param options
Will check and convert a `.png` to `.icns` if necessary and augment
options.icon with the result
@param inpOptions will need options.platform and options.icon
@param {augmentIconsCallback} callback | [
"@callback",
"augmentIconsCallback",
"@param",
"error",
"@param",
"options",
"Will",
"check",
"and",
"convert",
"a",
".",
"png",
"to",
".",
"icns",
"if",
"necessary",
"and",
"augment",
"options",
".",
"icon",
"with",
"the",
"result"
] | b959956a38ce51a9dd95d42308f0a6c66489b624 | https://github.com/jiahaog/nativefier/blob/b959956a38ce51a9dd95d42308f0a6c66489b624/src/build/iconBuild.js#L34-L104 | train | Build the image from the input options | [
30522,
3853,
12696,
8569,
4014,
2094,
1006,
1999,
16340,
9285,
1010,
2655,
5963,
1007,
1063,
9530,
3367,
7047,
1027,
4874,
1012,
23911,
1006,
1063,
1065,
1010,
1999,
16340,
9285,
1007,
1025,
9530,
3367,
2709,
9289,
20850,
8684,
1027,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mochajs/mocha | lib/errors.js | createInvalidArgumentValueError | function createInvalidArgumentValueError(message, argument, value, reason) {
var err = new TypeError(message);
err.code = 'ERR_MOCHA_INVALID_ARG_VALUE';
err.argument = argument;
err.value = value;
err.reason = typeof reason !== 'undefined' ? reason : 'is invalid';
return err;
} | javascript | function createInvalidArgumentValueError(message, argument, value, reason) {
var err = new TypeError(message);
err.code = 'ERR_MOCHA_INVALID_ARG_VALUE';
err.argument = argument;
err.value = value;
err.reason = typeof reason !== 'undefined' ? reason : 'is invalid';
return err;
} | [
"function",
"createInvalidArgumentValueError",
"(",
"message",
",",
"argument",
",",
"value",
",",
"reason",
")",
"{",
"var",
"err",
"=",
"new",
"TypeError",
"(",
"message",
")",
";",
"err",
".",
"code",
"=",
"'ERR_MOCHA_INVALID_ARG_VALUE'",
";",
"err",
".",
... | Creates an error object to be thrown when an argument did not use the supported value
@public
@param {string} message - Error message to be displayed.
@param {string} argument - Argument name.
@param {string} value - Argument value.
@param {string} [reason] - Why value is invalid.
@returns {Error} instance detailing t... | [
"Creates",
"an",
"error",
"object",
"to",
"be",
"thrown",
"when",
"an",
"argument",
"did",
"not",
"use",
"the",
"supported",
"value"
] | 9b00fedb610241e33f7592c40164e42a38a793cf | https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/errors.js#L108-L115 | train | Creates an error object for an invalid argument value | [
30522,
3853,
3443,
2378,
10175,
8524,
10623,
27417,
9189,
2389,
5657,
2121,
29165,
1006,
4471,
1010,
6685,
1010,
3643,
1010,
3114,
1007,
1063,
13075,
9413,
2099,
1027,
2047,
2828,
2121,
29165,
1006,
4471,
1007,
1025,
9413,
2099,
1012,
3642,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
BrainJS/brain.js | dist/recurrent/matrix/add-b.js | addB | function addB(product, left, right) {
for (var i = 0; i < product.deltas.length; i++) {
left.deltas[i] = product.deltas[i];
right.deltas[i] = product.deltas[i];
}
} | javascript | function addB(product, left, right) {
for (var i = 0; i < product.deltas.length; i++) {
left.deltas[i] = product.deltas[i];
right.deltas[i] = product.deltas[i];
}
} | [
"function",
"addB",
"(",
"product",
",",
"left",
",",
"right",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"product",
".",
"deltas",
".",
"length",
";",
"i",
"++",
")",
"{",
"left",
".",
"deltas",
"[",
"i",
"]",
"=",
"product",
... | adds {from} deltas to {left} and {right} deltas
@param {Matrix} product
@param {Matrix} left
@param {Matrix} right | [
"adds",
"{",
"from",
"}",
"deltas",
"to",
"{",
"left",
"}",
"and",
"{",
"right",
"}",
"deltas"
] | ab09bfc74a0d29d4731dcbdebfa17aeba7f7b1ef | https://github.com/BrainJS/brain.js/blob/ab09bfc74a0d29d4731dcbdebfa17aeba7f7b1ef/dist/recurrent/matrix/add-b.js#L13-L18 | train | Add a product to the left and right vectors | [
30522,
3853,
5587,
2497,
1006,
4031,
1010,
2187,
1010,
2157,
1007,
1063,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
4031,
1012,
7160,
2015,
1012,
3091,
1025,
1045,
1009,
1009,
1007,
1063,
2187,
1012,
7160,
2015,
1031,
1045,
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.demokit/src/sap/ui/demokit/explored/view/master.controller.js | function () {
// subscribe to routing
this.router = UIComponent.getRouterFor(this);
this.router.attachRoutePatternMatched(this.onRouteMatched, this);
// subscribe to app events
this._component = Component.getOwnerComponentFor(this.getView());
this._component.getEventBus().subscribe("app", "selectEnti... | javascript | function () {
// subscribe to routing
this.router = UIComponent.getRouterFor(this);
this.router.attachRoutePatternMatched(this.onRouteMatched, this);
// subscribe to app events
this._component = Component.getOwnerComponentFor(this.getView());
this._component.getEventBus().subscribe("app", "selectEnti... | [
"function",
"(",
")",
"{",
"// subscribe to routing",
"this",
".",
"router",
"=",
"UIComponent",
".",
"getRouterFor",
"(",
"this",
")",
";",
"this",
".",
"router",
".",
"attachRoutePatternMatched",
"(",
"this",
".",
"onRouteMatched",
",",
"this",
")",
";",
"... | ====== init ==================================================================== | [
"======",
"init",
"===================================================================="
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.demokit/src/sap/ui/demokit/explored/view/master.controller.js#L40-L56 | train | subscribe to routing events | [
30522,
3853,
1006,
1007,
1063,
1013,
1013,
4942,
29234,
2000,
16972,
2023,
1012,
2799,
2099,
1027,
21318,
9006,
29513,
3372,
1012,
2131,
22494,
3334,
29278,
1006,
2023,
1007,
1025,
2023,
1012,
2799,
2099,
1012,
22476,
22494,
2618,
4502,
120... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/JSUtils/ScopeManager.js | getFileInfo | function getFileInfo(session, preventPartialUpdates) {
var start = session.getCursor(),
end = start,
document = session.editor.document,
path = document.file.fullPath,
isHtmlFile = LanguageManager.getLanguageForPath(path).getId() === "html",
result;
... | javascript | function getFileInfo(session, preventPartialUpdates) {
var start = session.getCursor(),
end = start,
document = session.editor.document,
path = document.file.fullPath,
isHtmlFile = LanguageManager.getLanguageForPath(path).getId() === "html",
result;
... | [
"function",
"getFileInfo",
"(",
"session",
",",
"preventPartialUpdates",
")",
"{",
"var",
"start",
"=",
"session",
".",
"getCursor",
"(",
")",
",",
"end",
"=",
"start",
",",
"document",
"=",
"session",
".",
"editor",
".",
"document",
",",
"path",
"=",
"d... | Get an object that describes what tern needs to know about the updated
file to produce a hint. As a side-effect of this calls the document
changes are reset.
@param {!Session} session - the current session
@param {boolean=} preventPartialUpdates - if true, disallow partial updates.
Optional, defaults to false.
@return... | [
"Get",
"an",
"object",
"that",
"describes",
"what",
"tern",
"needs",
"to",
"know",
"about",
"the",
"updated",
"file",
"to",
"produce",
"a",
"hint",
".",
"As",
"a",
"side",
"-",
"effect",
"of",
"this",
"calls",
"the",
"document",
"changes",
"are",
"reset"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L592-L621 | train | getFileInfo - Get file info | [
30522,
3853,
2131,
8873,
19856,
14876,
1006,
5219,
1010,
4652,
19362,
20925,
6279,
27122,
1007,
1063,
13075,
2707,
1027,
5219,
1012,
2131,
10841,
25301,
2099,
1006,
1007,
1010,
2203,
1027,
2707,
1010,
6254,
1027,
5219,
1012,
3559,
1012,
625... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
NetEase/pomelo | lib/util/appUtil.js | function(app) {
app.loadConfigBaseApp(Constants.RESERVED.MASTER, Constants.FILEPATH.MASTER);
app.master = app.get(Constants.RESERVED.MASTER);
} | javascript | function(app) {
app.loadConfigBaseApp(Constants.RESERVED.MASTER, Constants.FILEPATH.MASTER);
app.master = app.get(Constants.RESERVED.MASTER);
} | [
"function",
"(",
"app",
")",
"{",
"app",
".",
"loadConfigBaseApp",
"(",
"Constants",
".",
"RESERVED",
".",
"MASTER",
",",
"Constants",
".",
"FILEPATH",
".",
"MASTER",
")",
";",
"app",
".",
"master",
"=",
"app",
".",
"get",
"(",
"Constants",
".",
"RESER... | Load master info from config/master.json. | [
"Load",
"master",
"info",
"from",
"config",
"/",
"master",
".",
"json",
"."
] | defcf019631ed399cc4dad932d3b028a04a039a4 | https://github.com/NetEase/pomelo/blob/defcf019631ed399cc4dad932d3b028a04a039a4/lib/util/appUtil.js#L155-L158 | train | Load the master config | [
30522,
3853,
1006,
10439,
1007,
1063,
10439,
1012,
7170,
8663,
8873,
18259,
11022,
29098,
1006,
5377,
2015,
1012,
9235,
1012,
3040,
1010,
5377,
2015,
1012,
5371,
15069,
1012,
3040,
1007,
1025,
10439,
1012,
3040,
1027,
10439,
1012,
2131,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js | function (padding) {
var p = (typeof padding === "number") ? [padding] : padding;
if (p.length === 1) {
p[1] = p[0];
}
if (p.length === 2) {
p[2] = p[0];
}
if (p.length === 3) {
p[3] = p[1];
... | javascript | function (padding) {
var p = (typeof padding === "number") ? [padding] : padding;
if (p.length === 1) {
p[1] = p[0];
}
if (p.length === 2) {
p[2] = p[0];
}
if (p.length === 3) {
p[3] = p[1];
... | [
"function",
"(",
"padding",
")",
"{",
"var",
"p",
"=",
"(",
"typeof",
"padding",
"===",
"\"number\"",
")",
"?",
"[",
"padding",
"]",
":",
"padding",
";",
"if",
"(",
"p",
".",
"length",
"===",
"1",
")",
"{",
"p",
"[",
"1",
"]",
"=",
"p",
"[",
... | Convert CSS padding shorthand to longhand
@param {number|Array.number} padding Element padding
@return {Array.number} | [
"Convert",
"CSS",
"padding",
"shorthand",
"to",
"longhand"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/BezierCurveEditor.js#L218-L232 | train | Returns an array of padding numbers | [
30522,
3853,
1006,
11687,
30524,
1029,
1031,
11687,
4667,
1033,
1024,
11687,
4667,
1025,
2065,
1006,
1052,
1012,
3091,
1027,
1027,
1027,
1015,
1007,
1063,
1052,
1031,
1015,
1033,
1027,
1052,
1031,
1014,
1033,
1025,
1065,
2065,
1006,
1052,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
uber/deck.gl | modules/core/src/lifecycle/create-props.js | createPropsPrototypeAndTypes | function createPropsPrototypeAndTypes(componentClass) {
const parent = componentClass.prototype;
if (!parent) {
return {
defaultProps: {}
};
}
const parentClass = Object.getPrototypeOf(componentClass);
const parentPropDefs = (parent && getPropsPrototypeAndTypes(parentClass)) || null;
// Pars... | javascript | function createPropsPrototypeAndTypes(componentClass) {
const parent = componentClass.prototype;
if (!parent) {
return {
defaultProps: {}
};
}
const parentClass = Object.getPrototypeOf(componentClass);
const parentPropDefs = (parent && getPropsPrototypeAndTypes(parentClass)) || null;
// Pars... | [
"function",
"createPropsPrototypeAndTypes",
"(",
"componentClass",
")",
"{",
"const",
"parent",
"=",
"componentClass",
".",
"prototype",
";",
"if",
"(",
"!",
"parent",
")",
"{",
"return",
"{",
"defaultProps",
":",
"{",
"}",
"}",
";",
"}",
"const",
"parentCla... | Build defaultProps and propType objects by walking component prototype chain | [
"Build",
"defaultProps",
"and",
"propType",
"objects",
"by",
"walking",
"component",
"prototype",
"chain"
] | a2010448b7f268bbd03617b812334c68a6b9e5b2 | https://github.com/uber/deck.gl/blob/a2010448b7f268bbd03617b812334c68a6b9e5b2/modules/core/src/lifecycle/create-props.js#L92-L136 | train | Create prop descriptors and prop types | [
30522,
3853,
3443,
21572,
4523,
21572,
3406,
13874,
5685,
13874,
2015,
1006,
6922,
26266,
1007,
1063,
9530,
3367,
6687,
1027,
6922,
26266,
1012,
8773,
1025,
2065,
1006,
999,
6687,
1007,
1063,
2709,
1063,
12398,
21572,
4523,
1024,
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... |
kriasoft/react-starter-kit | tools/lib/overrideRules.js | overrideRules | function overrideRules(rules, patch) {
return rules.map(ruleToPatch => {
let rule = patch(ruleToPatch);
if (rule.rules) {
rule = { ...rule, rules: overrideRules(rule.rules, patch) };
}
if (rule.oneOf) {
rule = { ...rule, oneOf: overrideRules(rule.oneOf, patch) };
}
return rule;
}... | javascript | function overrideRules(rules, patch) {
return rules.map(ruleToPatch => {
let rule = patch(ruleToPatch);
if (rule.rules) {
rule = { ...rule, rules: overrideRules(rule.rules, patch) };
}
if (rule.oneOf) {
rule = { ...rule, oneOf: overrideRules(rule.oneOf, patch) };
}
return rule;
}... | [
"function",
"overrideRules",
"(",
"rules",
",",
"patch",
")",
"{",
"return",
"rules",
".",
"map",
"(",
"ruleToPatch",
"=>",
"{",
"let",
"rule",
"=",
"patch",
"(",
"ruleToPatch",
")",
";",
"if",
"(",
"rule",
".",
"rules",
")",
"{",
"rule",
"=",
"{",
... | React Starter Kit (https://www.reactstarterkit.com/)
Copyright © 2014-present Kriasoft, LLC. All rights reserved.
This source code is licensed under the MIT license found in the
LICENSE.txt file in the root directory of this source tree. | [
"React",
"Starter",
"Kit",
"(",
"https",
":",
"//",
"www",
".",
"reactstarterkit",
".",
"com",
"/",
")"
] | 8d6c018f3198dec2a580ecafb011a32f06e38dbf | https://github.com/kriasoft/react-starter-kit/blob/8d6c018f3198dec2a580ecafb011a32f06e38dbf/tools/lib/overrideRules.js#L10-L21 | train | override rules with patch | [
30522,
3853,
2058,
15637,
6820,
4244,
1006,
3513,
1010,
8983,
1007,
1063,
2709,
3513,
1012,
4949,
1006,
3627,
14399,
4017,
2818,
1027,
1028,
1063,
2292,
3627,
1027,
8983,
1006,
3627,
14399,
4017,
2818,
1007,
1025,
2065,
1006,
3627,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js | function (sLiteral, sType, sPath) {
function checkNaN(nValue) {
if (!isFinite(nValue)) { // this rejects NaN, Infinity, -Infinity
throw new Error(sPath + ": Not a valid " + sType + " literal: " + sLiteral);
}
return nValue;
}
if (sLiteral === "null") {
return null;
}
switch (sType... | javascript | function (sLiteral, sType, sPath) {
function checkNaN(nValue) {
if (!isFinite(nValue)) { // this rejects NaN, Infinity, -Infinity
throw new Error(sPath + ": Not a valid " + sType + " literal: " + sLiteral);
}
return nValue;
}
if (sLiteral === "null") {
return null;
}
switch (sType... | [
"function",
"(",
"sLiteral",
",",
"sType",
",",
"sPath",
")",
"{",
"function",
"checkNaN",
"(",
"nValue",
")",
"{",
"if",
"(",
"!",
"isFinite",
"(",
"nValue",
")",
")",
"{",
"// this rejects NaN, Infinity, -Infinity",
"throw",
"new",
"Error",
"(",
"sPath",
... | Parses a literal to the model value. The types "Edm.Binary" and "Edm.String" are
unsupported.
@param {string} sLiteral The literal value
@param {string} sType The type
@param {string} sPath The path for this literal (for error messages)
@returns {*} The model value
@throws {Error} If the type is invalid or unsupported... | [
"Parses",
"a",
"literal",
"to",
"the",
"model",
"value",
".",
"The",
"types",
"Edm",
".",
"Binary",
"and",
"Edm",
".",
"String",
"are",
"unsupported",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js#L910-L946 | train | Returns the value of an object literal | [
30522,
3853,
1006,
18036,
21673,
1010,
2358,
18863,
1010,
14690,
2232,
1007,
1063,
3853,
4638,
7229,
1006,
1050,
10175,
5657,
1007,
1063,
2065,
1006,
999,
2003,
16294,
4221,
1006,
1050,
10175,
5657,
1007,
1007,
1063,
1013,
1013,
2023,
19164... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/geo/geoCreator.js | function (originRegionArr, mapName, nameMap) {
// Not use the original
var regionsArr = (originRegionArr || []).slice();
var dataNameMap = zrUtil.createHashMap();
for (var i = 0; i < regionsArr.length; i++) {
dataNameMap.set(regionsArr[i].name, regionsArr[i]);
}
... | javascript | function (originRegionArr, mapName, nameMap) {
// Not use the original
var regionsArr = (originRegionArr || []).slice();
var dataNameMap = zrUtil.createHashMap();
for (var i = 0; i < regionsArr.length; i++) {
dataNameMap.set(regionsArr[i].name, regionsArr[i]);
}
... | [
"function",
"(",
"originRegionArr",
",",
"mapName",
",",
"nameMap",
")",
"{",
"// Not use the original",
"var",
"regionsArr",
"=",
"(",
"originRegionArr",
"||",
"[",
"]",
")",
".",
"slice",
"(",
")",
";",
"var",
"dataNameMap",
"=",
"zrUtil",
".",
"createHash... | Fill given regions array
@param {Array.<Object>} originRegionArr
@param {string} mapName
@param {Object} [nameMap]
@return {Array} | [
"Fill",
"given",
"regions",
"array"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/coord/geo/geoCreator.js#L219-L235 | train | Get regions array from the map | [
30522,
3853,
1006,
4761,
23784,
2906,
2099,
1010,
4949,
18442,
1010,
2171,
2863,
2361,
1007,
1063,
1013,
1013,
2025,
2224,
1996,
2434,
13075,
4655,
2906,
2099,
1027,
1006,
4761,
23784,
2906,
2099,
1064,
1064,
1031,
1033,
1007,
1012,
14704,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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(html) {
var range = rangy.createRange(this.doc),
node = this.doc.createElement('DIV'),
fragment = this.doc.createDocumentFragment(),
lastChild;
node.innerHTML = html;
lastChild = node.lastChild;
while (node.firstChild) {
fragment.appendChild(n... | javascript | function(html) {
var range = rangy.createRange(this.doc),
node = this.doc.createElement('DIV'),
fragment = this.doc.createDocumentFragment(),
lastChild;
node.innerHTML = html;
lastChild = node.lastChild;
while (node.firstChild) {
fragment.appendChild(n... | [
"function",
"(",
"html",
")",
"{",
"var",
"range",
"=",
"rangy",
".",
"createRange",
"(",
"this",
".",
"doc",
")",
",",
"node",
"=",
"this",
".",
"doc",
".",
"createElement",
"(",
"'DIV'",
")",
",",
"fragment",
"=",
"this",
".",
"doc",
".",
"create... | Insert html at the caret position and move the cursor after the inserted html
@param {String} html HTML string to insert
@example
selection.insertHTML("<p>foobar</p>"); | [
"Insert",
"html",
"at",
"the",
"caret",
"position",
"and",
"move",
"the",
"cursor",
"after",
"the",
"inserted",
"html"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L9161-L9178 | train | Creates a new element with the given HTML | [
30522,
3853,
1006,
16129,
1007,
1063,
13075,
2846,
1027,
8369,
2100,
1012,
3443,
24388,
2063,
1006,
2023,
1012,
9986,
1007,
1010,
13045,
1027,
2023,
1012,
9986,
1012,
3443,
12260,
3672,
1006,
1005,
4487,
2615,
1005,
1007,
1010,
15778,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SheetJS/js-xlsx | xlsx.js | parse_BrtWbProp | function parse_BrtWbProp(data, length) {
var o = ({});
var flags = data.read_shift(4);
o.defaultThemeVersion = data.read_shift(4);
var strName = (length > 8) ? parse_XLWideString(data) : "";
if(strName.length > 0) o.CodeName = strName;
o.autoCompressPictures = !!(flags & 0x10000);
o.backupFile = !!(flags & 0x40)... | javascript | function parse_BrtWbProp(data, length) {
var o = ({});
var flags = data.read_shift(4);
o.defaultThemeVersion = data.read_shift(4);
var strName = (length > 8) ? parse_XLWideString(data) : "";
if(strName.length > 0) o.CodeName = strName;
o.autoCompressPictures = !!(flags & 0x10000);
o.backupFile = !!(flags & 0x40)... | [
"function",
"parse_BrtWbProp",
"(",
"data",
",",
"length",
")",
"{",
"var",
"o",
"=",
"(",
"{",
"}",
")",
";",
"var",
"flags",
"=",
"data",
".",
"read_shift",
"(",
"4",
")",
";",
"o",
".",
"defaultThemeVersion",
"=",
"data",
".",
"read_shift",
"(",
... | /* [MS-XLSB] 2.4.815 BrtWbProp | [
"/",
"*",
"[",
"MS",
"-",
"XLSB",
"]",
"2",
".",
"4",
".",
"815",
"BrtWbProp"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L14787-L14809 | train | Parse BrtWbProp | [
30522,
3853,
11968,
3366,
1035,
7987,
2102,
2860,
2497,
21572,
2361,
1006,
2951,
1010,
3091,
1007,
1063,
13075,
1051,
1027,
1006,
1063,
1065,
1007,
1025,
13075,
9245,
1027,
2951,
1012,
3191,
1035,
5670,
1006,
1018,
1007,
1025,
1051,
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... |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/tabs.js | tabBrowser_getTabPanelElement | function tabBrowser_getTabPanelElement(tabIndex, elemString)
{
var index = tabIndex ? tabIndex : this.selectedIndex;
var elemStr = elemString ? elemString : "";
// Get the tab panel and check if an element has to be fetched
var panel = this.getElement({type: "tabs_tabPanel", subtype: "tab", value: th... | javascript | function tabBrowser_getTabPanelElement(tabIndex, elemString)
{
var index = tabIndex ? tabIndex : this.selectedIndex;
var elemStr = elemString ? elemString : "";
// Get the tab panel and check if an element has to be fetched
var panel = this.getElement({type: "tabs_tabPanel", subtype: "tab", value: th... | [
"function",
"tabBrowser_getTabPanelElement",
"(",
"tabIndex",
",",
"elemString",
")",
"{",
"var",
"index",
"=",
"tabIndex",
"?",
"tabIndex",
":",
"this",
".",
"selectedIndex",
";",
"var",
"elemStr",
"=",
"elemString",
"?",
"elemString",
":",
"\"\"",
";",
"// G... | Creates the child element of the tab's notification bar
@param {number} tabIndex
(Optional) Index of the tab to check
@param {string} elemString
(Optional) Lookup string of the notification bar's child element
@return The created child element
@type {ElemBase} | [
"Creates",
"the",
"child",
"element",
"of",
"the",
"tab",
"s",
"notification",
"bar"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/tabs.js#L352-L362 | train | Get the tab panel element | [
30522,
3853,
21628,
12618,
9333,
2121,
1035,
2131,
2696,
2497,
9739,
12260,
16930,
4765,
1006,
21628,
22254,
10288,
1010,
3449,
6633,
3367,
4892,
1007,
1063,
13075,
5950,
1027,
21628,
22254,
10288,
1029,
21628,
22254,
10288,
1024,
2023,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js | buildPropertyPaths | function buildPropertyPaths(oObject, sObjectName) {
Object.keys(oObject).forEach(function (sProperty) {
var sPropertyPath = _Helper.buildPath(sObjectName, sProperty),
vPropertyValue = oObject[sProperty];
if (sProperty === "@$ui5._") {
return; // ignore private namespace
}
if (vProp... | javascript | function buildPropertyPaths(oObject, sObjectName) {
Object.keys(oObject).forEach(function (sProperty) {
var sPropertyPath = _Helper.buildPath(sObjectName, sProperty),
vPropertyValue = oObject[sProperty];
if (sProperty === "@$ui5._") {
return; // ignore private namespace
}
if (vProp... | [
"function",
"buildPropertyPaths",
"(",
"oObject",
",",
"sObjectName",
")",
"{",
"Object",
".",
"keys",
"(",
"oObject",
")",
".",
"forEach",
"(",
"function",
"(",
"sProperty",
")",
"{",
"var",
"sPropertyPath",
"=",
"_Helper",
".",
"buildPath",
"(",
"sObjectNa... | /*
Creates an array of all property paths for a given object
@param {object} oObject
@param {object} [sObjectName] The name of the complex property | [
"/",
"*",
"Creates",
"an",
"array",
"of",
"all",
"property",
"paths",
"for",
"a",
"given",
"object"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js#L1236-L1251 | train | Build property paths for the given object | [
30522,
3853,
3857,
21572,
4842,
3723,
15069,
2015,
1006,
1051,
16429,
20614,
1010,
17540,
20614,
18442,
1007,
1063,
4874,
1012,
6309,
1006,
1051,
16429,
20614,
1007,
1012,
18921,
6776,
1006,
3853,
1006,
11867,
18981,
15010,
1007,
1063,
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... |
SAP/openui5 | lib/jsdoc/transform-apijson-for-sdk.js | createApiRefApiJson | function createApiRefApiJson(oChainObject) {
if (returnOutputFiles) {
// If requested, return data instead of writing to FS (required by UI5 Tooling/UI5 Builder)
return JSON.stringify(oChainObject.parsedData);
}
let sOutputDir = path.dirname(oChainObject.outputFile);
// Create dir if it does not exist
... | javascript | function createApiRefApiJson(oChainObject) {
if (returnOutputFiles) {
// If requested, return data instead of writing to FS (required by UI5 Tooling/UI5 Builder)
return JSON.stringify(oChainObject.parsedData);
}
let sOutputDir = path.dirname(oChainObject.outputFile);
// Create dir if it does not exist
... | [
"function",
"createApiRefApiJson",
"(",
"oChainObject",
")",
"{",
"if",
"(",
"returnOutputFiles",
")",
"{",
"// If requested, return data instead of writing to FS (required by UI5 Tooling/UI5 Builder)",
"return",
"JSON",
".",
"stringify",
"(",
"oChainObject",
".",
"parsedData",... | Create api.json from parsed data
@param oChainObject chain object | [
"Create",
"api",
".",
"json",
"from",
"parsed",
"data"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/lib/jsdoc/transform-apijson-for-sdk.js#L747-L761 | train | Creates the JSON file for the API reference | [
30522,
3853,
3443,
9331,
7442,
7011,
8197,
22578,
2239,
1006,
28166,
8113,
16429,
20614,
1007,
1063,
2065,
1006,
2709,
5833,
18780,
8873,
4244,
1007,
1063,
1013,
1013,
2065,
7303,
1010,
2709,
2951,
2612,
1997,
3015,
2000,
1042,
2015,
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... |
postmanlabs/newman | lib/run/options.js | function (location, options, callback) {
if (_.isArray(location)) { return callback(null, location); }
util.fetch(location, function (err, data) {
if (err) {
return callback(err);
}
// Try loading as a JSON, fall-back to CSV. ... | javascript | function (location, options, callback) {
if (_.isArray(location)) { return callback(null, location); }
util.fetch(location, function (err, data) {
if (err) {
return callback(err);
}
// Try loading as a JSON, fall-back to CSV. ... | [
"function",
"(",
"location",
",",
"options",
",",
"callback",
")",
"{",
"if",
"(",
"_",
".",
"isArray",
"(",
"location",
")",
")",
"{",
"return",
"callback",
"(",
"null",
",",
"location",
")",
";",
"}",
"util",
".",
"fetch",
"(",
"location",
",",
"... | The iterationData loader module, with support for JSON or CSV data files.
@param {String|Object[]} location - The path to the iteration data file for the current collection run, or
the array of iteration data objects.
@param {Object} options - The set of wrapped options.
@param {Function} callback - The function invok... | [
"The",
"iterationData",
"loader",
"module",
"with",
"support",
"for",
"JSON",
"or",
"CSV",
"data",
"files",
"."
] | c05a5a1e82aa3c2021e94ba09e627ba4718af69e | https://github.com/postmanlabs/newman/blob/c05a5a1e82aa3c2021e94ba09e627ba4718af69e/lib/run/options.js#L261-L300 | train | Load the content of a file | [
30522,
3853,
1006,
3295,
1010,
7047,
1010,
2655,
5963,
1007,
1063,
2065,
1006,
1035,
1012,
18061,
11335,
2100,
1006,
3295,
1007,
1007,
1063,
2709,
2655,
5963,
1006,
19701,
1010,
3295,
1007,
1025,
1065,
21183,
4014,
1012,
18584,
1006,
3295,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_PtgRefN | function parse_PtgRefN(blob, length, opts) {
var type = (blob[blob.l] & 0x60)>>5;
blob.l += 1;
var loc = parse_RgceLocRel(blob, 0, opts);
return [type, loc];
} | javascript | function parse_PtgRefN(blob, length, opts) {
var type = (blob[blob.l] & 0x60)>>5;
blob.l += 1;
var loc = parse_RgceLocRel(blob, 0, opts);
return [type, loc];
} | [
"function",
"parse_PtgRefN",
"(",
"blob",
",",
"length",
",",
"opts",
")",
"{",
"var",
"type",
"=",
"(",
"blob",
"[",
"blob",
".",
"l",
"]",
"&",
"0x60",
")",
">>",
"5",
";",
"blob",
".",
"l",
"+=",
"1",
";",
"var",
"loc",
"=",
"parse_RgceLocRel"... | /* [MS-XLS] 2.5.198.88 ; [MS-XLSB] 2.5.97.72 TODO | [
"/",
"*",
"[",
"MS",
"-",
"XLS",
"]",
"2",
".",
"5",
".",
"198",
".",
"88",
";",
"[",
"MS",
"-",
"XLSB",
"]",
"2",
".",
"5",
".",
"97",
".",
"72",
"TODO"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L10431-L10436 | train | Parse a PTG RefN | [
30522,
3853,
11968,
3366,
1035,
13866,
17603,
2546,
2078,
1006,
1038,
4135,
2497,
1010,
3091,
1010,
23569,
2015,
1007,
1063,
13075,
2828,
1027,
1006,
1038,
4135,
2497,
1031,
1038,
4135,
2497,
1012,
1048,
1033,
1004,
1014,
2595,
16086,
1007,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js | function(oList){
var jListContRef = oList.$("lst");
if (jListContRef.hasClass("sapUiUx3ExactLstExpanded")) {
//collapse
oList._oPopup.close();
} else {
//expand
oList._oPopup.open();
}
} | javascript | function(oList){
var jListContRef = oList.$("lst");
if (jListContRef.hasClass("sapUiUx3ExactLstExpanded")) {
//collapse
oList._oPopup.close();
} else {
//expand
oList._oPopup.open();
}
} | [
"function",
"(",
"oList",
")",
"{",
"var",
"jListContRef",
"=",
"oList",
".",
"$",
"(",
"\"lst\"",
")",
";",
"if",
"(",
"jListContRef",
".",
"hasClass",
"(",
"\"sapUiUx3ExactLstExpanded\"",
")",
")",
"{",
"//collapse",
"oList",
".",
"_oPopup",
".",
"close"... | Toggles the vertical Collapse State | [
"Toggles",
"the",
"vertical",
"Collapse",
"State"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.ux3/src/sap/ui/ux3/ExactList.js#L1362-L1371 | train | If the list has a class sapUiUx3ExactLstExpanded then collapse the list | [
30522,
3853,
1006,
19330,
2923,
1007,
1063,
13075,
1046,
9863,
8663,
7913,
2546,
1027,
19330,
2923,
1012,
1002,
1006,
1000,
1048,
3367,
1000,
1007,
1025,
2065,
1006,
1046,
9863,
8663,
7913,
2546,
1012,
2038,
26266,
1006,
1000,
20066,
10179,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | Collection | function Collection(cy, elements, options) {
if (cy === undefined || !core(cy)) {
error('A collection must have a reference to the core');
return;
}
var map = new Map$1();
var createdElements = false;
if (!elements) {
elements = [];
} else if (elements.length > 0 && plainObject(elements[0]) &&... | javascript | function Collection(cy, elements, options) {
if (cy === undefined || !core(cy)) {
error('A collection must have a reference to the core');
return;
}
var map = new Map$1();
var createdElements = false;
if (!elements) {
elements = [];
} else if (elements.length > 0 && plainObject(elements[0]) &&... | [
"function",
"Collection",
"(",
"cy",
",",
"elements",
",",
"options",
")",
"{",
"if",
"(",
"cy",
"===",
"undefined",
"||",
"!",
"core",
"(",
"cy",
")",
")",
"{",
"error",
"(",
"'A collection must have a reference to the core'",
")",
";",
"return",
";",
"}"... | represents a set of nodes, edges, or both together | [
"represents",
"a",
"set",
"of",
"nodes",
"edges",
"or",
"both",
"together"
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L11811-L11880 | train | A collection of elements | [
30522,
3853,
3074,
1006,
22330,
1010,
3787,
1010,
7047,
1007,
1063,
2065,
1006,
22330,
1027,
1027,
1027,
6151,
28344,
1064,
1064,
999,
4563,
1006,
22330,
1007,
1007,
1063,
7561,
1006,
1005,
1037,
3074,
2442,
2031,
1037,
4431,
2000,
1996,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/filesystem/impls/appshell/AppshellFileSystem.js | unlink | function unlink(path, callback) {
appshell.fs.unlink(path, function (err) {
callback(_mapError(err));
});
} | javascript | function unlink(path, callback) {
appshell.fs.unlink(path, function (err) {
callback(_mapError(err));
});
} | [
"function",
"unlink",
"(",
"path",
",",
"callback",
")",
"{",
"appshell",
".",
"fs",
".",
"unlink",
"(",
"path",
",",
"function",
"(",
"err",
")",
"{",
"callback",
"(",
"_mapError",
"(",
"err",
")",
")",
";",
"}",
")",
";",
"}"
] | Unlink (i.e., permanently delete) the file or directory at the given path,
calling back asynchronously with a possibly null FileSystemError string.
Directories will be unlinked even when non-empty.
@param {string} path
@param {function(string)=} callback | [
"Unlink",
"(",
"i",
".",
"e",
".",
"permanently",
"delete",
")",
"the",
"file",
"or",
"directory",
"at",
"the",
"given",
"path",
"calling",
"back",
"asynchronously",
"with",
"a",
"possibly",
"null",
"FileSystemError",
"string",
".",
"Directories",
"will",
"b... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/impls/appshell/AppshellFileSystem.js#L470-L474 | train | unlink the file at the given path | [
30522,
3853,
4895,
13767,
1006,
4130,
1010,
2655,
5963,
1007,
1063,
18726,
18223,
1012,
1042,
2015,
1012,
4895,
13767,
1006,
4130,
1010,
3853,
1006,
9413,
2099,
1007,
1063,
2655,
5963,
1006,
1035,
4949,
2121,
29165,
1006,
9413,
2099,
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... |
aws/aws-sdk-js | lib/credentials/shared_ini_file_credentials.js | SharedIniFileCredentials | function SharedIniFileCredentials(options) {
AWS.Credentials.call(this);
options = options || {};
this.filename = options.filename;
this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile;
this.disableAssumeRole = Boolean(options.disableAssumeRole);
this.preferStat... | javascript | function SharedIniFileCredentials(options) {
AWS.Credentials.call(this);
options = options || {};
this.filename = options.filename;
this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile;
this.disableAssumeRole = Boolean(options.disableAssumeRole);
this.preferStat... | [
"function",
"SharedIniFileCredentials",
"(",
"options",
")",
"{",
"AWS",
".",
"Credentials",
".",
"call",
"(",
"this",
")",
";",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"this",
".",
"filename",
"=",
"options",
".",
"filename",
";",
"this",
".",
... | Creates a new SharedIniFileCredentials object.
@param options [map] a set of options
@option options profile [String] (AWS_PROFILE env var or 'default')
the name of the profile to load.
@option options filename [String] ('~/.aws/credentials' or defined by
AWS_SHARED_CREDENTIALS_FILE process env var)
the filename to us... | [
"Creates",
"a",
"new",
"SharedIniFileCredentials",
"object",
"."
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/credentials/shared_ini_file_credentials.js#L76-L88 | train | SharedIniFileCredentials constructor. | [
30522,
3853,
4207,
5498,
8873,
2571,
16748,
16454,
26340,
1006,
7047,
1007,
1063,
22091,
2015,
1012,
22496,
1012,
2655,
1006,
2023,
1007,
1025,
7047,
1027,
7047,
1064,
1064,
1063,
1065,
1025,
2023,
1012,
5371,
18442,
1027,
7047,
1012,
5371,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
uber/deck.gl | modules/json/src/parsers/convert-json.js | convertJSONViews | function convertJSONViews(jsonViews, configuration) {
if (!jsonViews) {
return jsonViews;
}
const viewCatalog = configuration.views || {};
jsonViews = Array.isArray(jsonViews) ? jsonViews : [jsonViews];
return jsonViews
.map(jsonView => {
// Try to find a view definition
const View = vie... | javascript | function convertJSONViews(jsonViews, configuration) {
if (!jsonViews) {
return jsonViews;
}
const viewCatalog = configuration.views || {};
jsonViews = Array.isArray(jsonViews) ? jsonViews : [jsonViews];
return jsonViews
.map(jsonView => {
// Try to find a view definition
const View = vie... | [
"function",
"convertJSONViews",
"(",
"jsonViews",
",",
"configuration",
")",
"{",
"if",
"(",
"!",
"jsonViews",
")",
"{",
"return",
"jsonViews",
";",
"}",
"const",
"viewCatalog",
"=",
"configuration",
".",
"views",
"||",
"{",
"}",
";",
"jsonViews",
"=",
"Ar... | Instantiates views: `{type: MapView, ...props}` to `MapView(...props)` | [
"Instantiates",
"views",
":",
"{",
"type",
":",
"MapView",
"...",
"props",
"}",
"to",
"MapView",
"(",
"...",
"props",
")"
] | a2010448b7f268bbd03617b812334c68a6b9e5b2 | https://github.com/uber/deck.gl/blob/a2010448b7f268bbd03617b812334c68a6b9e5b2/modules/json/src/parsers/convert-json.js#L80-L101 | train | Converts a JSON view definition to a view object | [
30522,
3853,
10463,
22578,
2239,
8584,
2015,
1006,
1046,
3385,
8584,
2015,
1010,
9563,
1007,
1063,
2065,
1006,
999,
1046,
3385,
8584,
2015,
1007,
1063,
2709,
1046,
3385,
8584,
2015,
1025,
1065,
9530,
3367,
3193,
11266,
23067,
2290,
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... |
caolan/async | lib/someSeries.js | someSeries | function someSeries(coll, iteratee, callback) {
return createTester(Boolean, res => res)(eachOfSeries, coll, iteratee, callback)
} | javascript | function someSeries(coll, iteratee, callback) {
return createTester(Boolean, res => res)(eachOfSeries, coll, iteratee, callback)
} | [
"function",
"someSeries",
"(",
"coll",
",",
"iteratee",
",",
"callback",
")",
"{",
"return",
"createTester",
"(",
"Boolean",
",",
"res",
"=>",
"res",
")",
"(",
"eachOfSeries",
",",
"coll",
",",
"iteratee",
",",
"callback",
")",
"}"
] | The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time.
@name someSeries
@static
@memberOf module:Collections
@method
@see [async.some]{@link module:Collections.some}
@alias anySeries
@category Collection
@param {Array|Iterable|AsyncIterable|Object} coll - A collection to ... | [
"The",
"same",
"as",
"[",
"some",
"]",
"{",
"@link",
"module",
":",
"Collections",
".",
"some",
"}",
"but",
"runs",
"only",
"a",
"single",
"async",
"operation",
"at",
"a",
"time",
"."
] | 4330d536c106592139fa82062494c9dba0da1fdb | https://github.com/caolan/async/blob/4330d536c106592139fa82062494c9dba0da1fdb/lib/someSeries.js#L26-L28 | train | A function that tests if a collection contains only a single value. | [
30522,
3853,
2070,
8043,
3111,
1006,
8902,
2140,
1010,
2009,
22139,
2063,
1010,
2655,
5963,
1007,
1063,
2709,
3443,
22199,
2121,
1006,
22017,
20898,
1010,
24501,
1027,
1028,
24501,
1007,
1006,
2169,
11253,
8043,
3111,
1010,
8902,
2140,
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/new-cap.js | isCapAllowed | function isCapAllowed(allowedMap, node, calleeName, pattern) {
const sourceText = sourceCode.getText(node.callee);
if (allowedMap[calleeName] || allowedMap[sourceText]) {
return true;
}
if (pattern && pattern.test(sourceText)) {
return tr... | javascript | function isCapAllowed(allowedMap, node, calleeName, pattern) {
const sourceText = sourceCode.getText(node.callee);
if (allowedMap[calleeName] || allowedMap[sourceText]) {
return true;
}
if (pattern && pattern.test(sourceText)) {
return tr... | [
"function",
"isCapAllowed",
"(",
"allowedMap",
",",
"node",
",",
"calleeName",
",",
"pattern",
")",
"{",
"const",
"sourceText",
"=",
"sourceCode",
".",
"getText",
"(",
"node",
".",
"callee",
")",
";",
"if",
"(",
"allowedMap",
"[",
"calleeName",
"]",
"||",
... | Check if capitalization is allowed for a CallExpression
@param {Object} allowedMap Object mapping calleeName to a Boolean
@param {ASTNode} node CallExpression node
@param {string} calleeName Capitalized callee name from a CallExpression
@param {Object} pattern RegExp object from options pattern
@returns {boolean} Retur... | [
"Check",
"if",
"capitalization",
"is",
"allowed",
"for",
"a",
"CallExpression"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/new-cap.js#L207-L226 | train | Check if the node is allowed by the given map | [
30522,
3853,
2003,
17695,
8095,
15096,
1006,
3039,
2863,
2361,
1010,
13045,
1010,
2655,
12129,
14074,
30524,
1025,
1065,
2065,
1006,
5418,
1004,
1004,
5418,
1012,
3231,
1006,
3120,
18209,
1007,
1007,
1063,
2709,
2995,
1025,
1065,
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... |
SeleniumHQ/selenium | javascript/selenium-core/scripts/ui-element.js | UIMap | function UIMap()
{
// the singleton pattern, split into two parts so that "new" can still
// be used, in addition to "getInstance()"
UIMap.self = this;
// need to attach variables directly to the Editor object in order for them
// to be in scope for Editor methods
if (is_IDE()) {
Ed... | javascript | function UIMap()
{
// the singleton pattern, split into two parts so that "new" can still
// be used, in addition to "getInstance()"
UIMap.self = this;
// need to attach variables directly to the Editor object in order for them
// to be in scope for Editor methods
if (is_IDE()) {
Ed... | [
"function",
"UIMap",
"(",
")",
"{",
"// the singleton pattern, split into two parts so that \"new\" can still",
"// be used, in addition to \"getInstance()\"",
"UIMap",
".",
"self",
"=",
"this",
";",
"// need to attach variables directly to the Editor object in order for them",
"// to be... | Construct the UI map object, and return it. Once the object is instantiated,
it binds to a global variable and will not leave scope.
@return new UIMap object | [
"Construct",
"the",
"UI",
"map",
"object",
"and",
"return",
"it",
".",
"Once",
"the",
"object",
"is",
"instantiated",
"it",
"binds",
"to",
"a",
"global",
"variable",
"and",
"will",
"not",
"leave",
"scope",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/scripts/ui-element.js#L822-L1163 | train | UIMap constructor. | [
30522,
3853,
21318,
2863,
2361,
1006,
1007,
1063,
1013,
1013,
1996,
28159,
5418,
1010,
3975,
2046,
2048,
3033,
2061,
2008,
1000,
2047,
1000,
2064,
2145,
1013,
1013,
2022,
2109,
1010,
1999,
2804,
2000,
1000,
2131,
7076,
26897,
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... |
akveo/nebular | docs/assets/ghspa.js | redirect | function redirect() {
l.replace(l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') + repo + '/?' +
(l.pathname ? 'p=' + l.pathname.replace(/&/g, '~and~').replace(repo, '') : '') +
(l.search ? '&q=' + l.search.slice(1).replace(/&/g, '~and~') : '') +
(l.hash))
} | javascript | function redirect() {
l.replace(l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') + repo + '/?' +
(l.pathname ? 'p=' + l.pathname.replace(/&/g, '~and~').replace(repo, '') : '') +
(l.search ? '&q=' + l.search.slice(1).replace(/&/g, '~and~') : '') +
(l.hash))
} | [
"function",
"redirect",
"(",
")",
"{",
"l",
".",
"replace",
"(",
"l",
".",
"protocol",
"+",
"'//'",
"+",
"l",
".",
"hostname",
"+",
"(",
"l",
".",
"port",
"?",
"':'",
"+",
"l",
".",
"port",
":",
"''",
")",
"+",
"repo",
"+",
"'/?'",
"+",
"(",
... | /* redirect all 404 trafic to index.html | [
"/",
"*",
"redirect",
"all",
"404",
"trafic",
"to",
"index",
".",
"html"
] | 6ae213cefd487e3036f933ba24dacf977a0592a5 | https://github.com/akveo/nebular/blob/6ae213cefd487e3036f933ba24dacf977a0592a5/docs/assets/ghspa.js#L30-L35 | train | redirect to the repo | [
30522,
3853,
2417,
7442,
6593,
1006,
1007,
1063,
1048,
1012,
5672,
1006,
1048,
1012,
8778,
1009,
1005,
1013,
1013,
1005,
1009,
1048,
1012,
3677,
18442,
1009,
1006,
1048,
1012,
3417,
1029,
1005,
1024,
1005,
1009,
1048,
1012,
3417,
1024,
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/rules/nonblock-statement-body-position.js | getOption | function getOption(keywordName) {
return context.options[1] && context.options[1].overrides && context.options[1].overrides[keywordName] ||
context.options[0] ||
"beside";
} | javascript | function getOption(keywordName) {
return context.options[1] && context.options[1].overrides && context.options[1].overrides[keywordName] ||
context.options[0] ||
"beside";
} | [
"function",
"getOption",
"(",
"keywordName",
")",
"{",
"return",
"context",
".",
"options",
"[",
"1",
"]",
"&&",
"context",
".",
"options",
"[",
"1",
"]",
".",
"overrides",
"&&",
"context",
".",
"options",
"[",
"1",
"]",
".",
"overrides",
"[",
"keyword... | ---------------------------------------------------------------------- Helpers ----------------------------------------------------------------------
Gets the applicable preference for a particular keyword
@param {string} keywordName The name of a keyword, e.g. 'if'
@returns {string} The applicable option for the keyw... | [
"----------------------------------------------------------------------",
"Helpers",
"----------------------------------------------------------------------",
"Gets",
"the",
"applicable",
"preference",
"for",
"a",
"particular",
"keyword"
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/nonblock-statement-body-position.js#L58-L62 | train | Get the option for the given keyword name | [
30522,
3853,
2131,
7361,
3508,
1006,
3145,
18351,
18442,
1007,
1063,
2709,
6123,
1012,
7047,
1031,
1015,
1033,
1004,
1004,
6123,
1012,
7047,
1031,
1015,
1033,
1012,
2058,
15637,
2015,
1004,
1004,
6123,
1012,
7047,
1031,
1015,
1033,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js | clone | function clone(vValue) {
return vValue === undefined || vValue === Infinity || vValue === -Infinity
|| /*NaN?*/vValue !== vValue // eslint-disable-line no-self-compare
? vValue
: JSON.parse(JSON.stringify(vValue));
} | javascript | function clone(vValue) {
return vValue === undefined || vValue === Infinity || vValue === -Infinity
|| /*NaN?*/vValue !== vValue // eslint-disable-line no-self-compare
? vValue
: JSON.parse(JSON.stringify(vValue));
} | [
"function",
"clone",
"(",
"vValue",
")",
"{",
"return",
"vValue",
"===",
"undefined",
"||",
"vValue",
"===",
"Infinity",
"||",
"vValue",
"===",
"-",
"Infinity",
"||",
"/*NaN?*/",
"vValue",
"!==",
"vValue",
"// eslint-disable-line no-self-compare",
"?",
"vValue",
... | Returns a clone of the given value, according to the rules of
<code>JSON.stringify</code>.
<b>Warning: <code>Date</code> objects will be turned into strings</b>
@param {*} vValue - Any value, including <code>undefined</code>
@returns {*} - A clone | [
"Returns",
"a",
"clone",
"of",
"the",
"given",
"value",
"according",
"to",
"the",
"rules",
"of",
"<code",
">",
"JSON",
".",
"stringify<",
"/",
"code",
">",
".",
"<b",
">",
"Warning",
":",
"<code",
">",
"Date<",
"/",
"code",
">",
"objects",
"will",
"b... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js#L185-L190 | train | Clone a value | [
30522,
3853,
17598,
1006,
1058,
10175,
5657,
1007,
1063,
2709,
1058,
10175,
5657,
1027,
1027,
1027,
6151,
28344,
1064,
1064,
1058,
10175,
5657,
1027,
1027,
1027,
15579,
1064,
1064,
1058,
10175,
5657,
1027,
1027,
1027,
1011,
15579,
1064,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GitbookIO/gitbook | lib/cli/getOutputFolder.js | getOutputFolder | function getOutputFolder(args) {
var bookRoot = path.resolve(args[0] || process.cwd());
var defaultOutputRoot = path.join(bookRoot, '_book');
var outputFolder = args[1]? path.resolve(process.cwd(), args[1]) : defaultOutputRoot;
return outputFolder;
} | javascript | function getOutputFolder(args) {
var bookRoot = path.resolve(args[0] || process.cwd());
var defaultOutputRoot = path.join(bookRoot, '_book');
var outputFolder = args[1]? path.resolve(process.cwd(), args[1]) : defaultOutputRoot;
return outputFolder;
} | [
"function",
"getOutputFolder",
"(",
"args",
")",
"{",
"var",
"bookRoot",
"=",
"path",
".",
"resolve",
"(",
"args",
"[",
"0",
"]",
"||",
"process",
".",
"cwd",
"(",
")",
")",
";",
"var",
"defaultOutputRoot",
"=",
"path",
".",
"join",
"(",
"bookRoot",
... | Return path to output folder
@param {Array} args
@return {String} | [
"Return",
"path",
"to",
"output",
"folder"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/cli/getOutputFolder.js#L9-L15 | train | Get the output folder | [
30522,
3853,
2131,
5833,
18780,
10371,
2121,
1006,
12098,
5620,
1007,
1063,
13075,
2338,
3217,
4140,
1027,
4130,
1012,
10663,
1006,
12098,
5620,
1031,
1014,
1033,
1064,
1064,
2832,
1012,
19296,
2094,
1006,
1007,
1007,
1025,
13075,
12398,
58... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.