repo stringclasses 192
values | path stringlengths 4 115 | func_name stringlengths 0 45 | original_string stringlengths 74 24k | language stringclasses 1
value | code stringlengths 74 24k | code_tokens listlengths 23 4.2k | docstring stringlengths 2 23.7k | docstring_tokens listlengths 1 810 | sha stringclasses 192
values | url stringlengths 90 200 | partition stringclasses 1
value | summary stringlengths 6 313 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SAP/openui5 | src/sap.ui.table/src/sap/ui/table/TableUtils.js | function(fn, mOptions) {
// Functionality taken from lodash open source library and adapted as needed
mOptions = Object.assign({
wait: 0,
leading: true
}, mOptions);
mOptions.maxWait = mOptions.wait;
mOptions.trailing = true;
mOptions.requestAnimationFrame = false;
return TableUtils.debou... | javascript | function(fn, mOptions) {
// Functionality taken from lodash open source library and adapted as needed
mOptions = Object.assign({
wait: 0,
leading: true
}, mOptions);
mOptions.maxWait = mOptions.wait;
mOptions.trailing = true;
mOptions.requestAnimationFrame = false;
return TableUtils.debou... | [
"function",
"(",
"fn",
",",
"mOptions",
")",
"{",
"// Functionality taken from lodash open source library and adapted as needed",
"mOptions",
"=",
"Object",
".",
"assign",
"(",
"{",
"wait",
":",
"0",
",",
"leading",
":",
"true",
"}",
",",
"mOptions",
")",
";",
"... | Invokes a method in a certain interval, regardless of how many times it was called.
@param {Function} fn The method to throttle.
@param {Object} [mOptions] The options that influence when the throttled method will be invoked.
@param {int} [mOptions.wait=0] The amount of milliseconds to wait until actually invoking the... | [
"Invokes",
"a",
"method",
"in",
"a",
"certain",
"interval",
"regardless",
"of",
"how",
"many",
"times",
"it",
"was",
"called",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableUtils.js#L1238-L1250 | train | Returns a function that will call fn after a specified number of milliseconds. | [
30522,
3853,
1006,
1042,
2078,
1010,
9587,
16790,
2015,
1007,
1063,
1013,
1013,
15380,
2579,
2013,
8840,
8883,
2232,
2330,
3120,
3075,
1998,
5967,
2004,
2734,
9587,
16790,
2015,
1027,
4874,
1012,
23911,
1006,
1063,
3524,
1024,
1014,
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/config/config-file.js | loadFromDisk | function loadFromDisk(configInfo, configContext) {
const config = loadConfigFile(configInfo);
// loadConfigFile will return null for a `package.json` file that does not have an `eslintConfig` property.
if (config) {
return loadObject(configContext, { config, filePath: configInfo.filePath, configFul... | javascript | function loadFromDisk(configInfo, configContext) {
const config = loadConfigFile(configInfo);
// loadConfigFile will return null for a `package.json` file that does not have an `eslintConfig` property.
if (config) {
return loadObject(configContext, { config, filePath: configInfo.filePath, configFul... | [
"function",
"loadFromDisk",
"(",
"configInfo",
",",
"configContext",
")",
"{",
"const",
"config",
"=",
"loadConfigFile",
"(",
"configInfo",
")",
";",
"// loadConfigFile will return null for a `package.json` file that does not have an `eslintConfig` property.",
"if",
"(",
"confi... | Loads a configuration file from the given file path.
@param {Object} configInfo The value from calling resolve() on a filename or package name.
@param {Config} configContext Config context
@returns {Object} The configuration information. | [
"Loads",
"a",
"configuration",
"file",
"from",
"the",
"given",
"file",
"path",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/config/config-file.js#L524-L533 | train | Load the config from disk | [
30522,
3853,
7170,
19699,
5358,
10521,
2243,
1006,
9530,
8873,
11528,
14876,
1010,
9530,
8873,
18195,
28040,
18413,
1007,
1063,
9530,
3367,
9530,
8873,
2290,
1027,
7170,
8663,
8873,
25708,
9463,
1006,
9530,
8873,
11528,
14876,
1007,
1025,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js | function () {
var i,
sPath = "",
sSegment;
for (i = 0; i < arguments.length; i += 1) {
sSegment = arguments[i];
if (sSegment || sSegment === 0) {
if (sPath && sPath !== "/" && sSegment[0] !== "(") {
sPath += "/";
}
sPath += sSegment;
}
}
return sPath;
} | javascript | function () {
var i,
sPath = "",
sSegment;
for (i = 0; i < arguments.length; i += 1) {
sSegment = arguments[i];
if (sSegment || sSegment === 0) {
if (sPath && sPath !== "/" && sSegment[0] !== "(") {
sPath += "/";
}
sPath += sSegment;
}
}
return sPath;
} | [
"function",
"(",
")",
"{",
"var",
"i",
",",
"sPath",
"=",
"\"\"",
",",
"sSegment",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"arguments",
".",
"length",
";",
"i",
"+=",
"1",
")",
"{",
"sSegment",
"=",
"arguments",
"[",
"i",
"]",
";",
"if... | Builds a relative path from the given arguments. Iterates over the arguments and appends
them to the path if defined and non-empty. The arguments are expected to be strings or
integers, but this is not checked.
Examples:
buildPath() --> ""
buildPath("base", "relative") --> "base/relative"
buildPath("base", "") --> "ba... | [
"Builds",
"a",
"relative",
"path",
"from",
"the",
"given",
"arguments",
".",
"Iterates",
"over",
"the",
"arguments",
"and",
"appends",
"them",
"to",
"the",
"path",
"if",
"defined",
"and",
"non",
"-",
"empty",
".",
"The",
"arguments",
"are",
"expected",
"to... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js#L113-L128 | train | Returns the path of the path segment | [
30522,
3853,
1006,
1007,
1063,
13075,
1045,
1010,
14690,
2232,
1027,
1000,
1000,
1010,
7020,
13910,
3672,
1025,
2005,
1006,
1045,
1027,
1014,
1025,
1045,
1026,
9918,
1012,
3091,
1025,
1045,
1009,
1027,
1015,
1007,
1063,
7020,
13910,
3672,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
KaTeX/KaTeX | webpack.common.js | createConfig | function createConfig(target /*: Target */, dev /*: boolean */,
minimize /*: boolean */) /*: Object */ {
const cssLoaders /*: Array<Object> */ = [{loader: 'css-loader'}];
if (minimize) {
cssLoaders[0].options = {importLoaders: 1};
cssLoaders.push({
loader: 'postcss-loader',
... | javascript | function createConfig(target /*: Target */, dev /*: boolean */,
minimize /*: boolean */) /*: Object */ {
const cssLoaders /*: Array<Object> */ = [{loader: 'css-loader'}];
if (minimize) {
cssLoaders[0].options = {importLoaders: 1};
cssLoaders.push({
loader: 'postcss-loader',
... | [
"function",
"createConfig",
"(",
"target",
"/*: Target */",
",",
"dev",
"/*: boolean */",
",",
"minimize",
"/*: boolean */",
")",
"/*: Object */",
"{",
"const",
"cssLoaders",
"/*: Array<Object> */",
"=",
"[",
"{",
"loader",
":",
"'css-loader'",
"}",
"]",
";",
"if"... | Create a webpack config for given target | [
"Create",
"a",
"webpack",
"config",
"for",
"given",
"target"
] | 17bfb247b88070267f3e5c7b21fe4a360fdf49d9 | https://github.com/KaTeX/KaTeX/blob/17bfb247b88070267f3e5c7b21fe4a360fdf49d9/webpack.common.js#L53-L158 | train | Create webpack config object | [
30522,
3853,
3443,
8663,
8873,
2290,
1006,
4539,
1013,
1008,
1024,
4539,
1008,
1013,
1010,
16475,
1013,
1008,
1024,
22017,
20898,
1008,
1013,
1010,
18478,
1013,
1008,
1024,
22017,
20898,
1008,
1013,
1007,
1013,
1008,
1024,
4874,
1008,
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... |
badges/shields | gatsby-node.js | createPages | async function createPages({ actions: { createPage } }) {
if (includeDevPages) {
createPage({
path: '/dev/logos',
component: require.resolve('./frontend/components/development/logo-page'),
})
}
categories.forEach(category => {
const { id } = category
createPage({
path: `/categor... | javascript | async function createPages({ actions: { createPage } }) {
if (includeDevPages) {
createPage({
path: '/dev/logos',
component: require.resolve('./frontend/components/development/logo-page'),
})
}
categories.forEach(category => {
const { id } = category
createPage({
path: `/categor... | [
"async",
"function",
"createPages",
"(",
"{",
"actions",
":",
"{",
"createPage",
"}",
"}",
")",
"{",
"if",
"(",
"includeDevPages",
")",
"{",
"createPage",
"(",
"{",
"path",
":",
"'/dev/logos'",
",",
"component",
":",
"require",
".",
"resolve",
"(",
"'./f... | Often in Gatsby context gets piped through GraphQL, but GraphQL adds unnecessary complexity here, so this uses the programmatic API. https://www.gatsbyjs.org/docs/using-gatsby-without-graphql/#the-approach-fetch-data-and-use-gatsbys-createpages-api | [
"Often",
"in",
"Gatsby",
"context",
"gets",
"piped",
"through",
"GraphQL",
"but",
"GraphQL",
"adds",
"unnecessary",
"complexity",
"here",
"so",
"this",
"uses",
"the",
"programmatic",
"API",
".",
"https",
":",
"//",
"www",
".",
"gatsbyjs",
".",
"org",
"/",
... | 283601423f3d1a19aae83bf62032d40683948636 | https://github.com/badges/shields/blob/283601423f3d1a19aae83bf62032d40683948636/gatsby-node.js#L22-L39 | train | Create pages for each category | [
30522,
2004,
6038,
2278,
3853,
3443,
13704,
2015,
1006,
1063,
4506,
1024,
1063,
3443,
13704,
1065,
1065,
1007,
1063,
2065,
1006,
2443,
6777,
13704,
2015,
1007,
1063,
3443,
13704,
1006,
1063,
4130,
1024,
1005,
1013,
16475,
1013,
25571,
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... |
feross/simple-peer | index.js | Peer | function Peer (opts) {
var self = this
if (!(self instanceof Peer)) return new Peer(opts)
self._id = randombytes(4).toString('hex').slice(0, 7)
self._debug('new peer %o', opts)
opts = Object.assign({
allowHalfOpen: false
}, opts)
stream.Duplex.call(self, opts)
self.channelName = opts.initiator
... | javascript | function Peer (opts) {
var self = this
if (!(self instanceof Peer)) return new Peer(opts)
self._id = randombytes(4).toString('hex').slice(0, 7)
self._debug('new peer %o', opts)
opts = Object.assign({
allowHalfOpen: false
}, opts)
stream.Duplex.call(self, opts)
self.channelName = opts.initiator
... | [
"function",
"Peer",
"(",
"opts",
")",
"{",
"var",
"self",
"=",
"this",
"if",
"(",
"!",
"(",
"self",
"instanceof",
"Peer",
")",
")",
"return",
"new",
"Peer",
"(",
"opts",
")",
"self",
".",
"_id",
"=",
"randombytes",
"(",
"4",
")",
".",
"toString",
... | WebRTC peer connection. Same API as node core `net.Socket`, plus a few extra methods.
Duplex stream.
@param {Object} opts | [
"WebRTC",
"peer",
"connection",
".",
"Same",
"API",
"as",
"node",
"core",
"net",
".",
"Socket",
"plus",
"a",
"few",
"extra",
"methods",
".",
"Duplex",
"stream",
"."
] | 3ed91bf631c4bf9c3b4bf5a85d004bb70d621707 | https://github.com/feross/simple-peer/blob/3ed91bf631c4bf9c3b4bf5a85d004bb70d621707/index.js#L20-L148 | train | Creates a new peer | [
30522,
3853,
8152,
1006,
23569,
2015,
1007,
1063,
13075,
2969,
1027,
2023,
2065,
1006,
999,
1006,
2969,
6013,
11253,
8152,
1007,
1007,
2709,
2047,
8152,
1006,
23569,
2015,
1007,
2969,
1012,
1035,
8909,
1027,
6721,
3762,
4570,
1006,
1018,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ccxt/ccxt | examples/js/fetch-all-tickers-to-files.js | async function () {
// while the array of all exchanges is not empty
while (exchanges.length > 0) {
// pop one exchange from the array
const exchange = exchanges.pop ()
// check if it has the necessary method implemented
if (exchange.has['fetchTickers']... | javascript | async function () {
// while the array of all exchanges is not empty
while (exchanges.length > 0) {
// pop one exchange from the array
const exchange = exchanges.pop ()
// check if it has the necessary method implemented
if (exchange.has['fetchTickers']... | [
"async",
"function",
"(",
")",
"{",
"// while the array of all exchanges is not empty",
"while",
"(",
"exchanges",
".",
"length",
">",
"0",
")",
"{",
"// pop one exchange from the array",
"const",
"exchange",
"=",
"exchanges",
".",
"pop",
"(",
")",
"// check if it has... | the worker function for each "async thread" | [
"the",
"worker",
"function",
"for",
"each",
"async",
"thread"
] | 8168069b9180a465532905e225586215e115a565 | https://github.com/ccxt/ccxt/blob/8168069b9180a465532905e225586215e115a565/examples/js/fetch-all-tickers-to-files.js#L31-L68 | train | fetch all the exchanges from the array | [
30522,
2004,
6038,
2278,
3853,
1006,
1007,
1063,
1013,
1013,
2096,
1996,
9140,
1997,
2035,
15800,
2003,
2025,
4064,
2096,
1006,
15800,
1012,
3091,
1028,
1014,
1007,
1063,
1013,
1013,
3769,
2028,
3863,
2013,
1996,
9140,
9530,
3367,
3863,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
apache/incubator-echarts | src/chart/sunburst/sunburstLayout.js | function (node, startAngle) {
if (!node) {
return;
}
var endAngle = startAngle;
// Render self
if (node !== virtualRoot) {
// Tree node is virtual, so it doesn't need to be drawn
var value = node.getValue();
... | javascript | function (node, startAngle) {
if (!node) {
return;
}
var endAngle = startAngle;
// Render self
if (node !== virtualRoot) {
// Tree node is virtual, so it doesn't need to be drawn
var value = node.getValue();
... | [
"function",
"(",
"node",
",",
"startAngle",
")",
"{",
"if",
"(",
"!",
"node",
")",
"{",
"return",
";",
"}",
"var",
"endAngle",
"=",
"startAngle",
";",
"// Render self",
"if",
"(",
"node",
"!==",
"virtualRoot",
")",
"{",
"// Tree node is virtual, so it doesn'... | Render a tree
@return increased angle | [
"Render",
"a",
"tree"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/sunburst/sunburstLayout.js#L86-L145 | train | Render node | [
30522,
3853,
1006,
13045,
1010,
2707,
5654,
2571,
1007,
1063,
2065,
1006,
999,
13045,
1007,
1063,
2709,
1025,
1065,
13075,
2203,
5654,
2571,
1027,
2707,
5654,
2571,
1025,
1013,
1013,
17552,
2969,
2065,
1006,
30524,
1005,
1056,
2342,
2000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/language/LanguageManager.js | _setLanguageForMode | function _setLanguageForMode(mode, language) {
if (_modeToLanguageMap[mode]) {
console.warn("CodeMirror mode \"" + mode + "\" is already used by language " + _modeToLanguageMap[mode]._name + " - cannot fully register language " + language._name +
" using the same mode. Some ... | javascript | function _setLanguageForMode(mode, language) {
if (_modeToLanguageMap[mode]) {
console.warn("CodeMirror mode \"" + mode + "\" is already used by language " + _modeToLanguageMap[mode]._name + " - cannot fully register language " + language._name +
" using the same mode. Some ... | [
"function",
"_setLanguageForMode",
"(",
"mode",
",",
"language",
")",
"{",
"if",
"(",
"_modeToLanguageMap",
"[",
"mode",
"]",
")",
"{",
"console",
".",
"warn",
"(",
"\"CodeMirror mode \\\"\"",
"+",
"mode",
"+",
"\"\\\" is already used by language \"",
"+",
"_modeT... | Adds a global mode-to-language association.
@param {!string} mode The mode to associate the language with
@param {!Language} language The language to associate with the mode | [
"Adds",
"a",
"global",
"mode",
"-",
"to",
"-",
"language",
"association",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/LanguageManager.js#L225-L233 | train | Sets the language for a mode | [
30522,
3853,
1035,
2275,
25023,
6692,
3351,
14192,
10244,
1006,
5549,
1010,
2653,
1007,
1063,
2065,
1006,
1035,
5549,
3406,
30524,
2109,
2011,
2653,
1000,
1009,
1035,
5549,
3406,
25023,
6692,
3351,
2863,
2361,
1031,
5549,
1033,
1012,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/NavigationAndHistory/NavigationProvider.js | _backupLiveMarkers | function _backupLiveMarkers(frames, editor) {
var index, frame;
for (index in frames) {
frame = frames[index];
if (frame.cm === editor._codeMirror) {
frame._handleEditorDestroy();
}
}
} | javascript | function _backupLiveMarkers(frames, editor) {
var index, frame;
for (index in frames) {
frame = frames[index];
if (frame.cm === editor._codeMirror) {
frame._handleEditorDestroy();
}
}
} | [
"function",
"_backupLiveMarkers",
"(",
"frames",
",",
"editor",
")",
"{",
"var",
"index",
",",
"frame",
";",
"for",
"(",
"index",
"in",
"frames",
")",
"{",
"frame",
"=",
"frames",
"[",
"index",
"]",
";",
"if",
"(",
"frame",
".",
"cm",
"===",
"editor"... | Create snapshot of last known live markers.
@private | [
"Create",
"snapshot",
"of",
"last",
"known",
"live",
"markers",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/NavigationProvider.js#L448-L456 | train | Backup live markers | [
30522,
3853,
1035,
10200,
3669,
3726,
10665,
2545,
1006,
11048,
1010,
3559,
1007,
1063,
13075,
5950,
1010,
4853,
1025,
2005,
1006,
5950,
1999,
11048,
1007,
1063,
4853,
1027,
11048,
1031,
5950,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/core/services/gesture/gesture.js | updatePointerState | function updatePointerState(ev, pointer) {
var point = getEventPoint(ev);
var x = pointer.x = point.pageX;
var y = pointer.y = point.pageY;
pointer.distanceX = x - pointer.startX;
pointer.distanceY = y - pointer.startY;
pointer.distance = Math.sqrt(
pointer.distanceX * pointer.distanceX + pointer.dista... | javascript | function updatePointerState(ev, pointer) {
var point = getEventPoint(ev);
var x = pointer.x = point.pageX;
var y = pointer.y = point.pageY;
pointer.distanceX = x - pointer.startX;
pointer.distanceY = y - pointer.startY;
pointer.distance = Math.sqrt(
pointer.distanceX * pointer.distanceX + pointer.dista... | [
"function",
"updatePointerState",
"(",
"ev",
",",
"pointer",
")",
"{",
"var",
"point",
"=",
"getEventPoint",
"(",
"ev",
")",
";",
"var",
"x",
"=",
"pointer",
".",
"x",
"=",
"point",
".",
"pageX",
";",
"var",
"y",
"=",
"pointer",
".",
"y",
"=",
"poi... | /*
Update the given pointer based upon the given DOMEvent.
Distance, velocity, direction, duration, etc | [
"/",
"*",
"Update",
"the",
"given",
"pointer",
"based",
"upon",
"the",
"given",
"DOMEvent",
".",
"Distance",
"velocity",
"direction",
"duration",
"etc"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/gesture/gesture.js#L751-L768 | train | Update the pointer state based on the event | [
30522,
3853,
10651,
8400,
2545,
12259,
1006,
23408,
1010,
20884,
1007,
1063,
13075,
2391,
1027,
2131,
18697,
3372,
8400,
1006,
23408,
1007,
1025,
13075,
1060,
1027,
20884,
1012,
1060,
1027,
2391,
1012,
3931,
2595,
1025,
13075,
30524,
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... |
nhn/tui.editor | src/js/extensions/table/tableDataHandler.js | _parseCell | function _parseCell(cell, rowIndex, colIndex) {
const $cell = $(cell);
const colspan = $cell.attr('colspan');
const rowspan = $cell.attr('rowspan');
const {nodeName} = cell;
if (nodeName !== 'TH' && nodeName !== 'TD') {
return null;
}
const cellData = {
nodeName: cell.nodeName,
colspan: cols... | javascript | function _parseCell(cell, rowIndex, colIndex) {
const $cell = $(cell);
const colspan = $cell.attr('colspan');
const rowspan = $cell.attr('rowspan');
const {nodeName} = cell;
if (nodeName !== 'TH' && nodeName !== 'TD') {
return null;
}
const cellData = {
nodeName: cell.nodeName,
colspan: cols... | [
"function",
"_parseCell",
"(",
"cell",
",",
"rowIndex",
",",
"colIndex",
")",
"{",
"const",
"$cell",
"=",
"$",
"(",
"cell",
")",
";",
"const",
"colspan",
"=",
"$cell",
".",
"attr",
"(",
"'colspan'",
")",
";",
"const",
"rowspan",
"=",
"$cell",
".",
"a... | Parse cell like td or th.
@param {HTMLElement} cell - cell element like td or th
@param {number} rowIndex - row index
@param {number} colIndex - column index
@returns {{
nodeName: string,
colspan: number,
rowspan: number,
content: string,
align: ?string
}}
@private | [
"Parse",
"cell",
"like",
"td",
"or",
"th",
"."
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/table/tableDataHandler.js#L22-L48 | train | Parse cell data | [
30522,
3853,
1035,
11968,
3366,
29109,
2140,
1006,
3526,
1010,
5216,
22254,
10288,
1010,
6972,
3207,
2595,
1007,
1063,
9530,
3367,
1002,
3526,
1027,
1002,
1006,
3526,
1007,
1025,
9530,
3367,
8902,
13102,
2319,
1027,
1002,
3526,
1012,
2012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GitbookIO/gitbook | lib/output/ebook/onFinish.js | runEbookConvert | function runEbookConvert(output) {
var logger = output.getLogger();
var options = output.getOptions();
var format = options.get('format');
var outputFolder = output.getRoot();
if (!format) {
return Promise(output);
}
return getConvertOptions(output)
.then(function(options) {
... | javascript | function runEbookConvert(output) {
var logger = output.getLogger();
var options = output.getOptions();
var format = options.get('format');
var outputFolder = output.getRoot();
if (!format) {
return Promise(output);
}
return getConvertOptions(output)
.then(function(options) {
... | [
"function",
"runEbookConvert",
"(",
"output",
")",
"{",
"var",
"logger",
"=",
"output",
".",
"getLogger",
"(",
")",
";",
"var",
"options",
"=",
"output",
".",
"getOptions",
"(",
")",
";",
"var",
"format",
"=",
"options",
".",
"get",
"(",
"'format'",
")... | Generate the ebook file as "index.pdf"
@param {Output}
@return {Output} | [
"Generate",
"the",
"ebook",
"file",
"as",
"index",
".",
"pdf"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/output/ebook/onFinish.js#L43-L78 | train | Runs ebook - convert | [
30522,
3853,
23276,
30524,
1025,
13075,
6434,
10371,
2121,
1027,
6434,
1012,
2131,
3217,
4140,
1006,
1007,
1025,
2065,
1006,
999,
4289,
1007,
1063,
2709,
4872,
1006,
6434,
1007,
1025,
1065,
2709,
2131,
8663,
16874,
7361,
9285,
1006,
6434,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GitbookIO/gitbook | lib/api/encodeSummary.js | function (iter) {
summary.getArticle(function(article) {
var jsonArticle = encodeSummaryArticle(article, false);
return iter(jsonArticle);
});
} | javascript | function (iter) {
summary.getArticle(function(article) {
var jsonArticle = encodeSummaryArticle(article, false);
return iter(jsonArticle);
});
} | [
"function",
"(",
"iter",
")",
"{",
"summary",
".",
"getArticle",
"(",
"function",
"(",
"article",
")",
"{",
"var",
"jsonArticle",
"=",
"encodeSummaryArticle",
"(",
"article",
",",
"false",
")",
";",
"return",
"iter",
"(",
"jsonArticle",
")",
";",
"}",
")... | Iterate over the summary, it stops when the "iter" returns false
@param {Function} iter | [
"Iterate",
"over",
"the",
"summary",
"it",
"stops",
"when",
"the",
"iter",
"returns",
"false"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/api/encodeSummary.js#L17-L23 | train | iter is a function that returns an array of objects | [
30522,
3853,
1006,
2009,
2121,
1007,
1063,
12654,
1012,
2131,
8445,
25128,
1006,
3853,
1006,
3720,
1007,
1063,
13075,
1046,
3385,
8445,
25128,
1027,
4372,
23237,
2819,
7849,
13380,
4588,
2571,
1006,
3720,
1010,
6270,
1007,
1025,
2709,
2009,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | _getName | function _getName(fullname, extension) {
return extension !== "" ? fullname.substring(0, fullname.length - extension.length - 1) : fullname;
} | javascript | function _getName(fullname, extension) {
return extension !== "" ? fullname.substring(0, fullname.length - extension.length - 1) : fullname;
} | [
"function",
"_getName",
"(",
"fullname",
",",
"extension",
")",
"{",
"return",
"extension",
"!==",
"\"\"",
"?",
"fullname",
".",
"substring",
"(",
"0",
",",
"fullname",
".",
"length",
"-",
"extension",
".",
"length",
"-",
"1",
")",
":",
"fullname",
";",
... | @private
Returns the name of a file without its extension.
@param {string} fullname The complete name of the file (not including the rest of the path)
@param {string} extension The file extension
@return {string} The fullname without the extension | [
"@private"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L82-L84 | train | Get the name of the file | [
30522,
3853,
1035,
2131,
18442,
1006,
2440,
18442,
1010,
5331,
1007,
1063,
2709,
5331,
999,
1027,
1027,
1000,
1000,
1029,
2440,
18442,
1012,
4942,
3367,
4892,
1006,
1014,
1010,
2440,
18442,
1012,
3091,
1011,
5331,
1012,
3091,
1011,
1015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ccxt/ccxt | build/transpile.js | copyFile | function copyFile (oldName, newName) {
let contents = fs.readFileSync (oldName, 'utf8')
fs.truncateSync (newName)
fs.writeFileSync (newName, contents)
} | javascript | function copyFile (oldName, newName) {
let contents = fs.readFileSync (oldName, 'utf8')
fs.truncateSync (newName)
fs.writeFileSync (newName, contents)
} | [
"function",
"copyFile",
"(",
"oldName",
",",
"newName",
")",
"{",
"let",
"contents",
"=",
"fs",
".",
"readFileSync",
"(",
"oldName",
",",
"'utf8'",
")",
"fs",
".",
"truncateSync",
"(",
"newName",
")",
"fs",
".",
"writeFileSync",
"(",
"newName",
",",
"con... | ----------------------------------------------------------------------------- | [
"-----------------------------------------------------------------------------"
] | 8168069b9180a465532905e225586215e115a565 | https://github.com/ccxt/ccxt/blob/8168069b9180a465532905e225586215e115a565/build/transpile.js#L750-L754 | train | Copy a file from another file to another file | [
30522,
3853,
6100,
8873,
2571,
1006,
2214,
18442,
1010,
2047,
18442,
1007,
1063,
2292,
8417,
1027,
1042,
2015,
1012,
30524,
4609,
16280,
6508,
12273,
1006,
2047,
18442,
1007,
1042,
2015,
1012,
4339,
8873,
4244,
6038,
2278,
1006,
2047,
18442... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Dogfalo/materialize | extras/noUiSlider/nouislider.js | eventEnd | function eventEnd ( event, data ) {
// The handle is no longer active, so remove the class.
if ( scope_ActiveHandle ) {
removeClass(scope_ActiveHandle, options.cssClasses.active);
scope_ActiveHandle = false;
}
// Remove cursor styles and ... | javascript | function eventEnd ( event, data ) {
// The handle is no longer active, so remove the class.
if ( scope_ActiveHandle ) {
removeClass(scope_ActiveHandle, options.cssClasses.active);
scope_ActiveHandle = false;
}
// Remove cursor styles and ... | [
"function",
"eventEnd",
"(",
"event",
",",
"data",
")",
"{",
"// The handle is no longer active, so remove the class.",
"if",
"(",
"scope_ActiveHandle",
")",
"{",
"removeClass",
"(",
"scope_ActiveHandle",
",",
"options",
".",
"cssClasses",
".",
"active",
")",
";",
"... | Unbind move events on document, call callbacks. | [
"Unbind",
"move",
"events",
"on",
"document",
"call",
"callbacks",
"."
] | 1122efadad8f1433d404696f7613e3cc13fb83a4 | https://github.com/Dogfalo/materialize/blob/1122efadad8f1433d404696f7613e3cc13fb83a4/extras/noUiSlider/nouislider.js#L1505-L1534 | train | End event handler for the handle | [
30522,
3853,
2724,
10497,
1006,
2724,
1010,
2951,
1007,
1063,
1013,
1013,
1996,
5047,
2003,
2053,
2936,
3161,
1010,
2061,
6366,
1996,
2465,
1012,
2065,
1006,
9531,
1035,
3161,
11774,
2571,
1007,
1063,
6366,
26266,
1006,
9531,
1035,
3161,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ApiDetail.controller.js | function (oView) {
var oController = oView.getController();
// Add the sub view to the current one
this._oContainerPage.addContent(oView);
this._oContainerPage.setBusy(false);
// Init the sub view and controller with the needed references.The view's are nested and work in a
// mimic way so the... | javascript | function (oView) {
var oController = oView.getController();
// Add the sub view to the current one
this._oContainerPage.addContent(oView);
this._oContainerPage.setBusy(false);
// Init the sub view and controller with the needed references.The view's are nested and work in a
// mimic way so the... | [
"function",
"(",
"oView",
")",
"{",
"var",
"oController",
"=",
"oView",
".",
"getController",
"(",
")",
";",
"// Add the sub view to the current one",
"this",
".",
"_oContainerPage",
".",
"addContent",
"(",
"oView",
")",
";",
"this",
".",
"_oContainerPage",
".",... | Init the Sub View and controller
@param {sap.ui.view} oView the pre-processed sub view
@private | [
"Init",
"the",
"Sub",
"View",
"and",
"controller"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.documentation/src/sap/ui/documentation/sdk/controller/ApiDetail.controller.js#L100-L121 | train | Adds the sub view to the container page | [
30522,
3853,
1006,
1051,
8584,
1007,
1063,
13075,
1051,
8663,
13181,
10820,
1027,
1051,
8584,
1012,
2131,
8663,
13181,
10820,
1006,
1007,
1025,
1013,
1013,
5587,
1996,
4942,
3193,
2000,
1996,
2783,
2028,
2023,
1012,
1035,
1051,
8663,
18249,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
transloadit/uppy | packages/@uppy/companion/src/server/helpers/utils.js | createSecret | function createSecret (secret) {
const hash = crypto.createHash('sha256')
hash.update(secret)
return hash.digest()
} | javascript | function createSecret (secret) {
const hash = crypto.createHash('sha256')
hash.update(secret)
return hash.digest()
} | [
"function",
"createSecret",
"(",
"secret",
")",
"{",
"const",
"hash",
"=",
"crypto",
".",
"createHash",
"(",
"'sha256'",
")",
"hash",
".",
"update",
"(",
"secret",
")",
"return",
"hash",
".",
"digest",
"(",
")",
"}"
] | Ensure that a user-provided `secret` is 32 bytes long (the length required
for an AES256 key) by hashing it with SHA256.
@param {string|Buffer} secret | [
"Ensure",
"that",
"a",
"user",
"-",
"provided",
"secret",
"is",
"32",
"bytes",
"long",
"(",
"the",
"length",
"required",
"for",
"an",
"AES256",
"key",
")",
"by",
"hashing",
"it",
"with",
"SHA256",
"."
] | 7ae18bf992d544a64da998f033258ec09a3de275 | https://github.com/transloadit/uppy/blob/7ae18bf992d544a64da998f033258ec09a3de275/packages/@uppy/companion/src/server/helpers/utils.js#L110-L114 | train | Creates a secret | [
30522,
3853,
9005,
8586,
13465,
1006,
3595,
1007,
1063,
9530,
3367,
23325,
1027,
19888,
2080,
1012,
3443,
14949,
2232,
1006,
1005,
21146,
17788,
2575,
1005,
1007,
23325,
1012,
10651,
1006,
3595,
1007,
2709,
23325,
1012,
17886,
1006,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aframevr/aframe | src/core/shader.js | function (data) {
this.attributes = this.initVariables(data, 'attribute');
this.uniforms = this.initVariables(data, 'uniform');
this.material = new (this.raw ? THREE.RawShaderMaterial : THREE.ShaderMaterial)({
// attributes: this.attributes,
uniforms: this.uniforms,
vertexShader: this.vert... | javascript | function (data) {
this.attributes = this.initVariables(data, 'attribute');
this.uniforms = this.initVariables(data, 'uniform');
this.material = new (this.raw ? THREE.RawShaderMaterial : THREE.ShaderMaterial)({
// attributes: this.attributes,
uniforms: this.uniforms,
vertexShader: this.vert... | [
"function",
"(",
"data",
")",
"{",
"this",
".",
"attributes",
"=",
"this",
".",
"initVariables",
"(",
"data",
",",
"'attribute'",
")",
";",
"this",
".",
"uniforms",
"=",
"this",
".",
"initVariables",
"(",
"data",
",",
"'uniform'",
")",
";",
"this",
"."... | Init handler. Similar to attachedCallback.
Called during shader initialization and is only run once. | [
"Init",
"handler",
".",
"Similar",
"to",
"attachedCallback",
".",
"Called",
"during",
"shader",
"initialization",
"and",
"is",
"only",
"run",
"once",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/core/shader.js#L52-L62 | train | Initialize the shader material | [
30522,
3853,
1006,
2951,
1007,
1063,
2023,
1012,
12332,
1027,
2023,
1012,
1999,
4183,
10755,
19210,
2015,
1006,
2951,
1010,
1005,
17961,
1005,
1007,
1025,
2023,
1012,
11408,
1027,
2023,
1012,
1999,
4183,
10755,
19210,
2015,
1006,
2951,
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... | |
cytoscape/cytoscape.js | dist/cytoscape.esm.js | deliver | function deliver(curr, state, name, value) {
if (curr.state === STATE_PENDING) {
curr.state = state;
/* [Promises/A+ 2.1.2.1, 2.1.3.1] */
curr[name] = value;
/* [Promises/A+ 2.1.2.2, 2.1.3.2] */
execute(curr);
}
return curr;
} | javascript | function deliver(curr, state, name, value) {
if (curr.state === STATE_PENDING) {
curr.state = state;
/* [Promises/A+ 2.1.2.1, 2.1.3.1] */
curr[name] = value;
/* [Promises/A+ 2.1.2.2, 2.1.3.2] */
execute(curr);
}
return curr;
} | [
"function",
"deliver",
"(",
"curr",
",",
"state",
",",
"name",
",",
"value",
")",
"{",
"if",
"(",
"curr",
".",
"state",
"===",
"STATE_PENDING",
")",
"{",
"curr",
".",
"state",
"=",
"state",
";",
"/* [Promises/A+ 2.1.2.1, 2.1.3.1] */",
"curr",
"[",
"name"... | /* deliver an action | [
"/",
"*",
"deliver",
"an",
"action"
] | ad2051b65e2243cfd953d8b24a8bf95bfa8559e5 | https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L5292-L5304 | train | Deliver a new value to the next node in the chain | [
30522,
3853,
8116,
1006,
12731,
12171,
1010,
2110,
1010,
2171,
1010,
3643,
1007,
1063,
2065,
1006,
12731,
12171,
1012,
2110,
1027,
1027,
1027,
2110,
1035,
14223,
1007,
1063,
12731,
12171,
1012,
2110,
1027,
2110,
1025,
1013,
1008,
1031,
1065... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
elastic/elasticsearch-js | api/api/msearch.js | buildMsearch | function buildMsearch (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [msearch](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html) request
*
* @param {list} index - A comm... | javascript | function buildMsearch (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
/**
* Perform a [msearch](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html) request
*
* @param {list} index - A comm... | [
"function",
"buildMsearch",
"(",
"opts",
")",
"{",
"// eslint-disable-next-line no-unused-vars",
"const",
"{",
"makeRequest",
",",
"ConfigurationError",
",",
"handleError",
",",
"snakeCaseKeys",
"}",
"=",
"opts",
"/**\n * Perform a [msearch](http://www.elastic.co/guide/en/ela... | /* 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/msearch.js#L25-L134 | train | Build a multi - search request | [
30522,
3853,
3857,
5244,
14644,
2818,
1006,
23569,
2015,
1007,
1063,
1013,
1013,
9686,
4115,
2102,
1011,
4487,
19150,
1011,
2279,
1011,
2240,
2053,
1011,
15171,
1011,
13075,
2015,
9530,
3367,
1063,
9338,
2063,
15500,
1010,
9563,
2121,
29165... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js | function(element) {
if (element.setActive) {
// Following line could cause a js error when the textarea is invisible
// See https://github.com/xing/wysihtml5/issues/9
try { element.setActive(); } catch(e) {}
} else {
var elementStyle = element.style,
originalScrollTop = doc.doc... | javascript | function(element) {
if (element.setActive) {
// Following line could cause a js error when the textarea is invisible
// See https://github.com/xing/wysihtml5/issues/9
try { element.setActive(); } catch(e) {}
} else {
var elementStyle = element.style,
originalScrollTop = doc.doc... | [
"function",
"(",
"element",
")",
"{",
"if",
"(",
"element",
".",
"setActive",
")",
"{",
"// Following line could cause a js error when the textarea is invisible",
"// See https://github.com/xing/wysihtml5/issues/9",
"try",
"{",
"element",
".",
"setActive",
"(",
")",
";",
... | With "setActive" IE offers a smart way of focusing elements without scrolling them into view:
http://msdn.microsoft.com/en-us/library/ms536738(v=vs.85).aspx
Other browsers need a more hacky way: (pssst don't tell my mama)
In order to prevent the element being scrolled into view when focusing it, we simply
move it out ... | [
"With",
"setActive",
"IE",
"offers",
"a",
"smart",
"way",
"of",
"focusing",
"elements",
"without",
"scrolling",
"them",
"into",
"view",
":",
"http",
":",
"//",
"msdn",
".",
"microsoft",
".",
"com",
"/",
"en",
"-",
"us",
"/",
"library",
"/",
"ms536738",
... | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L12543-L12578 | train | Set the active state of the element | [
30522,
3853,
1006,
5783,
1007,
1063,
2065,
1006,
5783,
1012,
2275,
19620,
1007,
1063,
1013,
1013,
2206,
2240,
2071,
3426,
1037,
1046,
2015,
7561,
2043,
1996,
3793,
12069,
2050,
2003,
8841,
1013,
1013,
30524,
1012,
2275,
19620,
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... | |
angular/material | src/components/dialog/dialog.js | walkDOM | function walkDOM(element) {
var elements = getParents(element);
for (var i = 0; i < elements.length; i++) {
elements[i].setAttribute('aria-hidden', isHidden);
}
} | javascript | function walkDOM(element) {
var elements = getParents(element);
for (var i = 0; i < elements.length; i++) {
elements[i].setAttribute('aria-hidden', isHidden);
}
} | [
"function",
"walkDOM",
"(",
"element",
")",
"{",
"var",
"elements",
"=",
"getParents",
"(",
"element",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"elements",
".",
"length",
";",
"i",
"++",
")",
"{",
"elements",
"[",
"i",
"]",
".",... | Walk DOM to apply or remove aria-hidden on sibling nodes
and parent sibling nodes | [
"Walk",
"DOM",
"to",
"apply",
"or",
"remove",
"aria",
"-",
"hidden",
"on",
"sibling",
"nodes",
"and",
"parent",
"sibling",
"nodes"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L1184-L1189 | train | Walk DOM tree to find all parent elements | [
30522,
3853,
3328,
9527,
1006,
5783,
1007,
1063,
13075,
3787,
1027,
2131,
19362,
11187,
1006,
5783,
1007,
1025,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
3787,
1012,
3091,
1025,
1045,
1009,
1009,
1007,
1063,
3787,
1031,
1045,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mochajs/mocha | lib/reporters/dot.js | Dot | function Dot(runner, options) {
Base.call(this, runner, options);
var self = this;
var width = (Base.window.width * 0.75) | 0;
var n = -1;
runner.on(EVENT_RUN_BEGIN, function() {
process.stdout.write('\n');
});
runner.on(EVENT_TEST_PENDING, function() {
if (++n % width === 0) {
process.st... | javascript | function Dot(runner, options) {
Base.call(this, runner, options);
var self = this;
var width = (Base.window.width * 0.75) | 0;
var n = -1;
runner.on(EVENT_RUN_BEGIN, function() {
process.stdout.write('\n');
});
runner.on(EVENT_TEST_PENDING, function() {
if (++n % width === 0) {
process.st... | [
"function",
"Dot",
"(",
"runner",
",",
"options",
")",
"{",
"Base",
".",
"call",
"(",
"this",
",",
"runner",
",",
"options",
")",
";",
"var",
"self",
"=",
"this",
";",
"var",
"width",
"=",
"(",
"Base",
".",
"window",
".",
"width",
"*",
"0.75",
")... | Constructs a new `Dot` 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",
"Dot",
"reporter",
"instance",
"."
] | 9b00fedb610241e33f7592c40164e42a38a793cf | https://github.com/mochajs/mocha/blob/9b00fedb610241e33f7592c40164e42a38a793cf/lib/reporters/dot.js#L34-L74 | train | Dot test suite. | [
30522,
3853,
11089,
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,
4293,
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/view/ViewCommandHandlers.js | restoreFontSize | function restoreFontSize() {
var fsStyle = prefs.get("fontSize"),
fsAdjustment = PreferencesManager.getViewState("fontSizeAdjustment");
if (fsAdjustment) {
// Always remove the old view state even if we also have the new view state.
PreferencesManager.setViewSta... | javascript | function restoreFontSize() {
var fsStyle = prefs.get("fontSize"),
fsAdjustment = PreferencesManager.getViewState("fontSizeAdjustment");
if (fsAdjustment) {
// Always remove the old view state even if we also have the new view state.
PreferencesManager.setViewSta... | [
"function",
"restoreFontSize",
"(",
")",
"{",
"var",
"fsStyle",
"=",
"prefs",
".",
"get",
"(",
"\"fontSize\"",
")",
",",
"fsAdjustment",
"=",
"PreferencesManager",
".",
"getViewState",
"(",
"\"fontSizeAdjustment\"",
")",
";",
"if",
"(",
"fsAdjustment",
")",
"{... | Restores the font size using the saved style and migrates the old fontSizeAdjustment
view state to the new fontSize, when required | [
"Restores",
"the",
"font",
"size",
"using",
"the",
"saved",
"style",
"and",
"migrates",
"the",
"old",
"fontSizeAdjustment",
"view",
"state",
"to",
"the",
"new",
"fontSize",
"when",
"required"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/ViewCommandHandlers.js#L405-L424 | train | Restore font size | [
30522,
3853,
9239,
14876,
7666,
4697,
1006,
1007,
1063,
13075,
1042,
4757,
27983,
1027,
3653,
10343,
1012,
2131,
1006,
1000,
15489,
5332,
4371,
1000,
1007,
1010,
1042,
3736,
2094,
29427,
3672,
1027,
18394,
24805,
4590,
1012,
2131,
8584,
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... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/AnnotationHelper.js | function (vRawValue, oDetails) {
var aMatches,
oModel = oDetails.context.getModel(),
sPath = oDetails.context.getPath();
function getExpression(sPrefix) {
if (sPath.slice(-1) === "/") {
// cut off trailing slash, happens with computed annotations
sPath = sPath.slice(0, -1);
}
... | javascript | function (vRawValue, oDetails) {
var aMatches,
oModel = oDetails.context.getModel(),
sPath = oDetails.context.getPath();
function getExpression(sPrefix) {
if (sPath.slice(-1) === "/") {
// cut off trailing slash, happens with computed annotations
sPath = sPath.slice(0, -1);
}
... | [
"function",
"(",
"vRawValue",
",",
"oDetails",
")",
"{",
"var",
"aMatches",
",",
"oModel",
"=",
"oDetails",
".",
"context",
".",
"getModel",
"(",
")",
",",
"sPath",
"=",
"oDetails",
".",
"context",
".",
"getPath",
"(",
")",
";",
"function",
"getExpressio... | A function that helps to interpret OData V4 annotations. It knows about the following
expressions:
<ul>
<li>"14.4 Constant Expressions" for "edm:Bool", "edm:Date",
"edm:DateTimeOffset", "edm:Decimal", "edm:Float", "edm:Guid", "edm:Int",
"edm:TimeOfDay".
<li>constant "14.4.11 Expression edm:String": This is turned into ... | [
"A",
"function",
"that",
"helps",
"to",
"interpret",
"OData",
"V4",
"annotations",
".",
"It",
"knows",
"about",
"the",
"following",
"expressions",
":",
"<ul",
">",
"<li",
">",
"14",
".",
"4",
"Constant",
"Expressions",
"for",
"edm",
":",
"Bool",
"edm",
"... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/AnnotationHelper.js#L161-L221 | train | Returns the expression for the given value. | [
30522,
3853,
1006,
27830,
10376,
10175,
5657,
1010,
30524,
6123,
1012,
2131,
15069,
1006,
1007,
1025,
3853,
2131,
10288,
20110,
3258,
1006,
11867,
2890,
8873,
2595,
1007,
1063,
2065,
1006,
14690,
2232,
1012,
14704,
1006,
1011,
1015,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
wix/Detox | detox/src/utils/exec.js | _logExecOutput | function _logExecOutput(log, process) {
let stdout = process.stdout || '';
let stderr = process.stderr || '';
if (process.platform === 'win32') {
stdout = stdout.replace(/\r\n/g, '\n');
stderr = stderr.replace(/\r\n/g, '\n');
}
if (stdout) {
log.trace({ event: 'EXEC_SUCCESS', stdout: true }, std... | javascript | function _logExecOutput(log, process) {
let stdout = process.stdout || '';
let stderr = process.stderr || '';
if (process.platform === 'win32') {
stdout = stdout.replace(/\r\n/g, '\n');
stderr = stderr.replace(/\r\n/g, '\n');
}
if (stdout) {
log.trace({ event: 'EXEC_SUCCESS', stdout: true }, std... | [
"function",
"_logExecOutput",
"(",
"log",
",",
"process",
")",
"{",
"let",
"stdout",
"=",
"process",
".",
"stdout",
"||",
"''",
";",
"let",
"stderr",
"=",
"process",
".",
"stderr",
"||",
"''",
";",
"if",
"(",
"process",
".",
"platform",
"===",
"'win32'... | /* istanbul ignore next | [
"/",
"*",
"istanbul",
"ignore",
"next"
] | 0ed5e8c7ba279a3a409130b4d4bad3f9a9c2f1f9 | https://github.com/wix/Detox/blob/0ed5e8c7ba279a3a409130b4d4bad3f9a9c2f1f9/detox/src/utils/exec.js#L69-L89 | train | Logs the exec output to the log | [
30522,
3853,
1035,
8833,
10288,
8586,
5833,
18780,
1006,
8833,
1010,
2832,
1007,
1063,
2292,
2358,
26797,
2102,
1027,
2832,
1012,
2358,
26797,
2102,
1064,
1064,
1005,
1005,
1025,
2292,
2358,
4063,
2099,
1027,
2832,
1012,
2358,
4063,
2099,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/language/HTMLDOMDiff.js | function (delta) {
edits.push.apply(edits, delta.edits);
moves.push.apply(moves, delta.moves);
queue.push.apply(queue, delta.newElements);
} | javascript | function (delta) {
edits.push.apply(edits, delta.edits);
moves.push.apply(moves, delta.moves);
queue.push.apply(queue, delta.newElements);
} | [
"function",
"(",
"delta",
")",
"{",
"edits",
".",
"push",
".",
"apply",
"(",
"edits",
",",
"delta",
".",
"edits",
")",
";",
"moves",
".",
"push",
".",
"apply",
"(",
"moves",
",",
"delta",
".",
"moves",
")",
";",
"queue",
".",
"push",
".",
"apply"... | Aggregates the child edits in the proper data structures.
@param {Object} delta edits, moves and newElements to add | [
"Aggregates",
"the",
"child",
"edits",
"in",
"the",
"proper",
"data",
"structures",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/HTMLDOMDiff.js#L561-L565 | train | Add an entry to the array of edits moves and newElements | [
30522,
3853,
1006,
7160,
1007,
1063,
10086,
2015,
1012,
5245,
1012,
6611,
1006,
10086,
2015,
1010,
7160,
1012,
10086,
2015,
1007,
1025,
5829,
1012,
5245,
1012,
6611,
1006,
5829,
1010,
7160,
1012,
5829,
1007,
1025,
24240,
1012,
5245,
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... | |
angular/material | src/core/util/animation/animate.js | function (transform, addTransition, transition) {
var css = {};
angular.forEach($mdConstant.CSS.TRANSFORM.split(' '), function (key) {
css[key] = transform;
});
if (addTransition) {
transition = transition || "all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important";
css.tr... | javascript | function (transform, addTransition, transition) {
var css = {};
angular.forEach($mdConstant.CSS.TRANSFORM.split(' '), function (key) {
css[key] = transform;
});
if (addTransition) {
transition = transition || "all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important";
css.tr... | [
"function",
"(",
"transform",
",",
"addTransition",
",",
"transition",
")",
"{",
"var",
"css",
"=",
"{",
"}",
";",
"angular",
".",
"forEach",
"(",
"$mdConstant",
".",
"CSS",
".",
"TRANSFORM",
".",
"split",
"(",
"' '",
")",
",",
"function",
"(",
"key",
... | Convert the translate CSS value to key/value pair(s). | [
"Convert",
"the",
"translate",
"CSS",
"value",
"to",
"key",
"/",
"value",
"pair",
"(",
"s",
")",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/util/animation/animate.js#L203-L215 | train | Returns a new CSS object with the given transform and transition | [
30522,
3853,
1006,
10938,
1010,
5587,
6494,
3619,
22753,
1010,
6653,
1007,
1063,
13075,
20116,
2015,
1027,
1063,
1065,
1025,
16108,
1012,
18921,
6776,
1006,
1002,
9108,
8663,
12693,
2102,
1012,
20116,
2015,
1012,
10938,
1012,
3975,
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... | |
SeleniumHQ/selenium | javascript/jsunit/app/jsUnitCore.js | _trueTypeOf | function _trueTypeOf(something) {
var result = typeof something;
try {
switch (result) {
case 'string':
case 'boolean':
case 'number':
break;
case 'object':
case 'function':
switch (something.constructor)
... | javascript | function _trueTypeOf(something) {
var result = typeof something;
try {
switch (result) {
case 'string':
case 'boolean':
case 'number':
break;
case 'object':
case 'function':
switch (something.constructor)
... | [
"function",
"_trueTypeOf",
"(",
"something",
")",
"{",
"var",
"result",
"=",
"typeof",
"something",
";",
"try",
"{",
"switch",
"(",
"result",
")",
"{",
"case",
"'string'",
":",
"case",
"'boolean'",
":",
"case",
"'number'",
":",
"break",
";",
"case",
"'ob... | + * A more functional typeof
+ * @param Object o
+ * @return String
+ | [
"+",
"*",
"A",
"more",
"functional",
"typeof",
"+",
"*"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/jsunit/app/jsUnitCore.js#L31-L75 | train | Returns true type of something | [
30522,
3853,
1035,
2995,
13874,
11253,
1006,
2242,
1007,
1063,
13075,
2765,
1027,
2828,
11253,
2242,
1025,
3046,
1063,
6942,
1006,
2765,
1007,
1063,
2553,
1005,
5164,
1005,
1024,
2553,
1005,
22017,
20898,
1005,
1024,
2553,
1005,
2193,
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... |
ColorlibHQ/AdminLTE | plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js | function(deep) {
var newObj = {},
i;
if (obj === null || !wysihtml5.lang.object(obj).isPlainObject()) {
return obj;
}
for (i in obj) {
if(obj.hasOwnProperty(i)) {
if (deep) {
newObj[i] = wysihtml5.lang.object(obj[i]).clone(deep);
} else... | javascript | function(deep) {
var newObj = {},
i;
if (obj === null || !wysihtml5.lang.object(obj).isPlainObject()) {
return obj;
}
for (i in obj) {
if(obj.hasOwnProperty(i)) {
if (deep) {
newObj[i] = wysihtml5.lang.object(obj[i]).clone(deep);
} else... | [
"function",
"(",
"deep",
")",
"{",
"var",
"newObj",
"=",
"{",
"}",
",",
"i",
";",
"if",
"(",
"obj",
"===",
"null",
"||",
"!",
"wysihtml5",
".",
"lang",
".",
"object",
"(",
"obj",
")",
".",
"isPlainObject",
"(",
")",
")",
"{",
"return",
"obj",
"... | @example
wysihtml5.lang.object({ foo: 1 }).clone();
// => { foo: 1 }
v0.4.14 adds options for deep clone : wysihtml5.lang.object({ foo: 1 }).clone(true); | [
"@example",
"wysihtml5",
".",
"lang",
".",
"object",
"(",
"{",
"foo",
":",
"1",
"}",
")",
".",
"clone",
"()",
";",
"//",
"=",
">",
"{",
"foo",
":",
"1",
"}"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js#L4778-L4796 | train | Clone the object | [
30522,
3853,
1006,
2784,
1007,
1063,
13075,
2047,
16429,
3501,
1027,
1063,
1065,
1010,
1045,
1025,
2065,
1006,
27885,
3501,
1027,
1027,
1027,
19701,
1064,
1064,
999,
1059,
7274,
19190,
21246,
2140,
2629,
1012,
11374,
1012,
4874,
1006,
27885... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/js/highlight-query-terms.js | makeQueryInfo | function makeQueryInfo() {
var rparam = /[^?#]*\?([^#]*&)?q=([^&#]*)(&|#|$)/,
rquote = /[.?*+|(){}\[\]\\]/g,
match = rparam.exec(document.URL) || rparam.exec(document.referrer),
qterms = match && decodeURIComponent(match[2].replace(/\+/g, " ")).split(/\s+/g),
classes,i,t;
if ( qterms ) {
// create... | javascript | function makeQueryInfo() {
var rparam = /[^?#]*\?([^#]*&)?q=([^&#]*)(&|#|$)/,
rquote = /[.?*+|(){}\[\]\\]/g,
match = rparam.exec(document.URL) || rparam.exec(document.referrer),
qterms = match && decodeURIComponent(match[2].replace(/\+/g, " ")).split(/\s+/g),
classes,i,t;
if ( qterms ) {
// create... | [
"function",
"makeQueryInfo",
"(",
")",
"{",
"var",
"rparam",
"=",
"/",
"[^?#]*\\?([^#]*&)?q=([^&#]*)(&|#|$)",
"/",
",",
"rquote",
"=",
"/",
"[.?*+|(){}\\[\\]\\\\]",
"/",
"g",
",",
"match",
"=",
"rparam",
".",
"exec",
"(",
"document",
".",
"URL",
")",
"||",
... | /*
Search the query parameters of the document URL and the referrer URL for Google-like query terms
(parameter name 'q'). If found, create a regular expression to find occurrences of any of the terms
and a map of CSS classes to be applied to each match. The map uses the lower case version of each term as key.
@returns... | [
"/",
"*",
"Search",
"the",
"query",
"parameters",
"of",
"the",
"document",
"URL",
"and",
"the",
"referrer",
"URL",
"for",
"Google",
"-",
"like",
"query",
"terms",
"(",
"parameter",
"name",
"q",
")",
".",
"If",
"found",
"create",
"a",
"regular",
"expressi... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.demokit/src/sap/ui/demokit/js/highlight-query-terms.js#L16-L51 | train | This function is used to make a query info object from a query string | [
30522,
3853,
2191,
4226,
2854,
2378,
14876,
1006,
1007,
1063,
13075,
1054,
28689,
2213,
1027,
1013,
1031,
1034,
1029,
1001,
1033,
1008,
1032,
1029,
1006,
1031,
30524,
1033,
1032,
1032,
1033,
1013,
1043,
1010,
2674,
1027,
1054,
28689,
2213,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js | function (oEvent) {
// early out if already open
if (this._oAssistantPopover && this._oAssistantPopover.isOpen()) {
return;
}
// create dialog lazily
if (!this._oAssistantPopover) {
this._oAssistantPopover = sap.ui.xmlfragment(this._SUPPORT_ASSISTANT_POPOVER_ID, "sap.ui.core.support.techinfo.Tech... | javascript | function (oEvent) {
// early out if already open
if (this._oAssistantPopover && this._oAssistantPopover.isOpen()) {
return;
}
// create dialog lazily
if (!this._oAssistantPopover) {
this._oAssistantPopover = sap.ui.xmlfragment(this._SUPPORT_ASSISTANT_POPOVER_ID, "sap.ui.core.support.techinfo.Tech... | [
"function",
"(",
"oEvent",
")",
"{",
"// early out if already open",
"if",
"(",
"this",
".",
"_oAssistantPopover",
"&&",
"this",
".",
"_oAssistantPopover",
".",
"isOpen",
"(",
")",
")",
"{",
"return",
";",
"}",
"// create dialog lazily",
"if",
"(",
"!",
"this"... | Opens a popover with extended configuration options
@param {sap.ui.base.Event} oEvent The button press event | [
"Opens",
"a",
"popover",
"with",
"extended",
"configuration",
"options"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/support/techinfo/TechnicalInfo.js#L394-L430 | train | Opens the assistant popup | [
30522,
3853,
1006,
1051,
18697,
3372,
1007,
1063,
1013,
1013,
2220,
2041,
2065,
2525,
2330,
2065,
1006,
2023,
1012,
1035,
1051,
12054,
30524,
28431,
2065,
1006,
999,
2023,
1012,
1035,
1051,
12054,
23137,
25856,
7361,
7840,
1007,
1063,
2023,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
exceljs/exceljs | lib/doc/defined-names.js | vGrow | function vGrow(yy, edge) {
const c = matrix.findCellAt(sheetName, yy, cell.col);
if (!c || !c.mark) { return false; }
range[edge] = yy;
c.mark = false;
return true;
} | javascript | function vGrow(yy, edge) {
const c = matrix.findCellAt(sheetName, yy, cell.col);
if (!c || !c.mark) { return false; }
range[edge] = yy;
c.mark = false;
return true;
} | [
"function",
"vGrow",
"(",
"yy",
",",
"edge",
")",
"{",
"const",
"c",
"=",
"matrix",
".",
"findCellAt",
"(",
"sheetName",
",",
"yy",
",",
"cell",
".",
"col",
")",
";",
"if",
"(",
"!",
"c",
"||",
"!",
"c",
".",
"mark",
")",
"{",
"return",
"false"... | grow vertical - only one col to worry about | [
"grow",
"vertical",
"-",
"only",
"one",
"col",
"to",
"worry",
"about"
] | c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2 | https://github.com/exceljs/exceljs/blob/c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2/lib/doc/defined-names.js#L87-L93 | train | grow the v - axis | [
30522,
3853,
1058,
16523,
5004,
1006,
1061,
2100,
1010,
3341,
1007,
1063,
9530,
3367,
1039,
1027,
8185,
1012,
2424,
29109,
20051,
1006,
7123,
18442,
1010,
1061,
2100,
1010,
3526,
1012,
8902,
1007,
1025,
2065,
1006,
999,
1039,
1064,
1064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ColorlibHQ/AdminLTE | bower_components/bootstrap/js/collapse.js | function (element, options) {
this.$element = $(element)
this.options = $.extend({}, Collapse.DEFAULTS, options)
this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
'[data-toggle="collapse"][data-target="#' + element.id + '"]')
this.tran... | javascript | function (element, options) {
this.$element = $(element)
this.options = $.extend({}, Collapse.DEFAULTS, options)
this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
'[data-toggle="collapse"][data-target="#' + element.id + '"]')
this.tran... | [
"function",
"(",
"element",
",",
"options",
")",
"{",
"this",
".",
"$element",
"=",
"$",
"(",
"element",
")",
"this",
".",
"options",
"=",
"$",
".",
"extend",
"(",
"{",
"}",
",",
"Collapse",
".",
"DEFAULTS",
",",
"options",
")",
"this",
".",
"$trig... | COLLAPSE PUBLIC CLASS DEFINITION ================================ | [
"COLLAPSE",
"PUBLIC",
"CLASS",
"DEFINITION",
"================================"
] | 19113c3cbc19a7afe0cfd3158d647064d2d30661 | https://github.com/ColorlibHQ/AdminLTE/blob/19113c3cbc19a7afe0cfd3158d647064d2d30661/bower_components/bootstrap/js/collapse.js#L17-L31 | train | Constructor for Collapse | [
30522,
3853,
1006,
5783,
1010,
7047,
1007,
1063,
2023,
1012,
1002,
5783,
1027,
1002,
1006,
5783,
1007,
2023,
1012,
7047,
1027,
1002,
1012,
7949,
1006,
1063,
1065,
1010,
7859,
1012,
12398,
2015,
1010,
7047,
1007,
2023,
1012,
1002,
9495,
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... | |
zloirock/core-js | packages/core-js/modules/web.url-search-params.js | append | function append(name, value) {
validateArgumentsLength(arguments.length, 2);
var state = getInternalParamsState(this);
state.entries.push({ key: name + '', value: value + '' });
if (state.updateURL) state.updateURL();
} | javascript | function append(name, value) {
validateArgumentsLength(arguments.length, 2);
var state = getInternalParamsState(this);
state.entries.push({ key: name + '', value: value + '' });
if (state.updateURL) state.updateURL();
} | [
"function",
"append",
"(",
"name",
",",
"value",
")",
"{",
"validateArgumentsLength",
"(",
"arguments",
".",
"length",
",",
"2",
")",
";",
"var",
"state",
"=",
"getInternalParamsState",
"(",
"this",
")",
";",
"state",
".",
"entries",
".",
"push",
"(",
"{... | `URLSearchParams.prototype.appent` method https://url.spec.whatwg.org/#dom-urlsearchparams-append | [
"URLSearchParams",
".",
"prototype",
".",
"appent",
"method",
"https",
":",
"//",
"url",
".",
"spec",
".",
"whatwg",
".",
"org",
"/",
"#dom",
"-",
"urlsearchparams",
"-",
"append"
] | fe7c8511a6d27d03a9b8e075b3351416aae95c58 | https://github.com/zloirock/core-js/blob/fe7c8511a6d27d03a9b8e075b3351416aae95c58/packages/core-js/modules/web.url-search-params.js#L150-L155 | train | Append a parameter to the end of the parameters array. | [
30522,
3853,
10439,
10497,
1006,
2171,
1010,
3643,
1007,
1063,
9398,
3686,
2906,
22850,
11187,
7770,
13512,
2232,
1006,
9918,
1012,
3091,
1010,
1016,
1007,
1025,
13075,
2110,
1027,
2131,
18447,
11795,
2389,
28689,
5244,
9153,
2618,
1006,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SheetJS/js-xlsx | xlsx.js | parse_BrtCellBool | function parse_BrtCellBool(data) {
var cell = parse_XLSBCell(data);
var fBool = data.read_shift(1);
return [cell, fBool, 'b'];
} | javascript | function parse_BrtCellBool(data) {
var cell = parse_XLSBCell(data);
var fBool = data.read_shift(1);
return [cell, fBool, 'b'];
} | [
"function",
"parse_BrtCellBool",
"(",
"data",
")",
"{",
"var",
"cell",
"=",
"parse_XLSBCell",
"(",
"data",
")",
";",
"var",
"fBool",
"=",
"data",
".",
"read_shift",
"(",
"1",
")",
";",
"return",
"[",
"cell",
",",
"fBool",
",",
"'b'",
"]",
";",
"}"
] | /* [MS-XLSB] 2.4.307 BrtCellBool | [
"/",
"*",
"[",
"MS",
"-",
"XLSB",
"]",
"2",
".",
"4",
".",
"307",
"BrtCellBool"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L13491-L13495 | train | Parse a BrtCellBool | [
30522,
3853,
11968,
3366,
1035,
7987,
13535,
5349,
5092,
4747,
1006,
2951,
1007,
1063,
13075,
3526,
1027,
11968,
3366,
1035,
28712,
19022,
29109,
2140,
1006,
2951,
1007,
1025,
13075,
1042,
5092,
4747,
1027,
2951,
1012,
3191,
1035,
5670,
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... |
Freeboard/freeboard | js/freeboard.thirdparty.js | function(target, date) {
var inst = this._getInst(target);
if (inst) {
this._setDate(inst, date);
this._updateDatepicker(inst);
this._updateAlternate(inst);
}
} | javascript | function(target, date) {
var inst = this._getInst(target);
if (inst) {
this._setDate(inst, date);
this._updateDatepicker(inst);
this._updateAlternate(inst);
}
} | [
"function",
"(",
"target",
",",
"date",
")",
"{",
"var",
"inst",
"=",
"this",
".",
"_getInst",
"(",
"target",
")",
";",
"if",
"(",
"inst",
")",
"{",
"this",
".",
"_setDate",
"(",
"inst",
",",
"date",
")",
";",
"this",
".",
"_updateDatepicker",
"(",... | /* Set the dates for a jQuery selection.
@param target element - the target input field or division or span
@param date Date - the new date | [
"/",
"*",
"Set",
"the",
"dates",
"for",
"a",
"jQuery",
"selection",
"."
] | 38789f6e8bd3d04f7d3b2c3427e509d00f2610fc | https://github.com/Freeboard/freeboard/blob/38789f6e8bd3d04f7d3b2c3427e509d00f2610fc/js/freeboard.thirdparty.js#L8138-L8145 | train | Sets the date of the specified datepicker. | [
30522,
3853,
1006,
4539,
1010,
3058,
1007,
1063,
13075,
16021,
2102,
1027,
2023,
1012,
1035,
2131,
7076,
2102,
1006,
4539,
1007,
1025,
2065,
1006,
16021,
2102,
1007,
1063,
2023,
1012,
1035,
2275,
13701,
1006,
16021,
2102,
1010,
3058,
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/discover_endpoint.js | addApiVersionHeader | function addApiVersionHeader(endpointRequest) {
var api = endpointRequest.service.api;
var apiVersion = api.apiVersion;
if (apiVersion && !endpointRequest.httpRequest.headers['x-amz-api-version']) {
endpointRequest.httpRequest.headers['x-amz-api-version'] = apiVersion;
}
} | javascript | function addApiVersionHeader(endpointRequest) {
var api = endpointRequest.service.api;
var apiVersion = api.apiVersion;
if (apiVersion && !endpointRequest.httpRequest.headers['x-amz-api-version']) {
endpointRequest.httpRequest.headers['x-amz-api-version'] = apiVersion;
}
} | [
"function",
"addApiVersionHeader",
"(",
"endpointRequest",
")",
"{",
"var",
"api",
"=",
"endpointRequest",
".",
"service",
".",
"api",
";",
"var",
"apiVersion",
"=",
"api",
".",
"apiVersion",
";",
"if",
"(",
"apiVersion",
"&&",
"!",
"endpointRequest",
".",
"... | add api version header to endpoint operation
@api private | [
"add",
"api",
"version",
"header",
"to",
"endpoint",
"operation"
] | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/discover_endpoint.js#L210-L216 | train | Add the x - amz - api - version header to the request if it doesn t already exist | [
30522,
3853,
5587,
9331,
16402,
10992,
4974,
2121,
1006,
2203,
8400,
2890,
15500,
1007,
1063,
13075,
17928,
1027,
2203,
8400,
2890,
15500,
1012,
2326,
1012,
17928,
1025,
13075,
17928,
27774,
1027,
17928,
1012,
17928,
27774,
1025,
2065,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/JSUtils/node/TernNodeDomain.js | _reportError | function _reportError(e, file) {
if (e instanceof Infer.TimedOut) {
// Post a message back to the main thread with timedout info
self.postMessage({
type: MessageIds.TERN_INFERENCE_TIMEDOUT,
file: file
});
} else {
_log("Error thrown in tern_node domain:" +... | javascript | function _reportError(e, file) {
if (e instanceof Infer.TimedOut) {
// Post a message back to the main thread with timedout info
self.postMessage({
type: MessageIds.TERN_INFERENCE_TIMEDOUT,
file: file
});
} else {
_log("Error thrown in tern_node domain:" +... | [
"function",
"_reportError",
"(",
"e",
",",
"file",
")",
"{",
"if",
"(",
"e",
"instanceof",
"Infer",
".",
"TimedOut",
")",
"{",
"// Post a message back to the main thread with timedout info",
"self",
".",
"postMessage",
"(",
"{",
"type",
":",
"MessageIds",
".",
"... | Report exception
@private
@param {Error} e - the error object | [
"Report",
"exception"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/node/TernNodeDomain.js#L73-L83 | train | Report an error to the log | [
30522,
3853,
1035,
6398,
29165,
1006,
1041,
1010,
5371,
1007,
1063,
2065,
1006,
1041,
6013,
11253,
1999,
7512,
1012,
22313,
5833,
1007,
1063,
1013,
1013,
2695,
1037,
4471,
2067,
2000,
1996,
2364,
11689,
2007,
22313,
5833,
18558,
2969,
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... |
showdownjs/showdown | src/subParsers/makehtml/lists.js | processListItems | function processListItems (listStr, trimTrailing) {
// The $g_list_level global keeps track of when we're inside a list.
// Each time we enter a list, we increment it; when we leave a list,
// we decrement. If it's zero, we're not in a list anymore.
//
// We do this because when we're not inside a l... | javascript | function processListItems (listStr, trimTrailing) {
// The $g_list_level global keeps track of when we're inside a list.
// Each time we enter a list, we increment it; when we leave a list,
// we decrement. If it's zero, we're not in a list anymore.
//
// We do this because when we're not inside a l... | [
"function",
"processListItems",
"(",
"listStr",
",",
"trimTrailing",
")",
"{",
"// The $g_list_level global keeps track of when we're inside a list.",
"// Each time we enter a list, we increment it; when we leave a list,",
"// we decrement. If it's zero, we're not in a list anymore.",
"//",
... | Process the contents of a single ordered or unordered list, splitting it
into individual list items.
@param {string} listStr
@param {boolean} trimTrailing
@returns {string} | [
"Process",
"the",
"contents",
"of",
"a",
"single",
"ordered",
"or",
"unordered",
"list",
"splitting",
"it",
"into",
"individual",
"list",
"items",
"."
] | 33bba54535d6fcdde5c82d2ec4d7a3bd951b5bb9 | https://github.com/showdownjs/showdown/blob/33bba54535d6fcdde5c82d2ec4d7a3bd951b5bb9/src/subParsers/makehtml/lists.js#L14-L137 | train | Process a list of items | [
30522,
3853,
2832,
9863,
4221,
5244,
1006,
7201,
16344,
1010,
12241,
6494,
16281,
1007,
1063,
1013,
1013,
1996,
1002,
1043,
1035,
2862,
1035,
2504,
3795,
7906,
2650,
1997,
2043,
2057,
1005,
2128,
2503,
1037,
2862,
1012,
1013,
1013,
2169,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/web/shared/middlewares/serve-public-file.js | servePublicFile | function servePublicFile(file, type, maxAge) {
const publicFileMiddleware = createPublicFileMiddleware(file, type, maxAge);
return function servePublicFile(req, res, next) {
if (req.path === '/' + file) {
return publicFileMiddleware(req, res, next);
} else {
return next(... | javascript | function servePublicFile(file, type, maxAge) {
const publicFileMiddleware = createPublicFileMiddleware(file, type, maxAge);
return function servePublicFile(req, res, next) {
if (req.path === '/' + file) {
return publicFileMiddleware(req, res, next);
} else {
return next(... | [
"function",
"servePublicFile",
"(",
"file",
",",
"type",
",",
"maxAge",
")",
"{",
"const",
"publicFileMiddleware",
"=",
"createPublicFileMiddleware",
"(",
"file",
",",
"type",
",",
"maxAge",
")",
";",
"return",
"function",
"servePublicFile",
"(",
"req",
",",
"... | ### servePublicFile Middleware Handles requests to robots.txt and favicon.ico (and caches them) | [
"###",
"servePublicFile",
"Middleware",
"Handles",
"requests",
"to",
"robots",
".",
"txt",
"and",
"favicon",
".",
"ico",
"(",
"and",
"caches",
"them",
")"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/web/shared/middlewares/serve-public-file.js#L48-L58 | train | servePublicFile - Creates a middleware that will serve public files | [
30522,
3853,
3710,
14289,
16558,
2594,
8873,
2571,
1006,
5371,
1010,
2828,
1010,
4098,
4270,
1007,
1063,
9530,
3367,
2270,
8873,
16930,
3593,
10362,
8059,
1027,
3443,
14289,
16558,
2594,
8873,
16930,
3593,
10362,
8059,
1006,
5371,
1010,
282... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
angular/material | src/core/services/layout/layout.js | attributeWithObserve | function attributeWithObserve(className) {
return ['$mdUtil', '$interpolate', "$log", function(_$mdUtil_, _$interpolate_, _$log_) {
$mdUtil = _$mdUtil_;
$interpolate = _$interpolate_;
$log = _$log_;
return {
restrict: 'A',
compile: function(element, attr) {
var li... | javascript | function attributeWithObserve(className) {
return ['$mdUtil', '$interpolate', "$log", function(_$mdUtil_, _$interpolate_, _$log_) {
$mdUtil = _$mdUtil_;
$interpolate = _$interpolate_;
$log = _$log_;
return {
restrict: 'A',
compile: function(element, attr) {
var li... | [
"function",
"attributeWithObserve",
"(",
"className",
")",
"{",
"return",
"[",
"'$mdUtil'",
",",
"'$interpolate'",
",",
"\"$log\"",
",",
"function",
"(",
"_$mdUtil_",
",",
"_$interpolate_",
",",
"_$log_",
")",
"{",
"$mdUtil",
"=",
"_$mdUtil_",
";",
"$interpolate... | ********************************************************************************* These functions create registration functions for AngularJS Material Layout attribute directives This provides easy translation to switch AngularJS Material attribute selectors to CLASS selectors and directives; which has huge performanc... | [
"*********************************************************************************",
"These",
"functions",
"create",
"registration",
"functions",
"for",
"AngularJS",
"Material",
"Layout",
"attribute",
"directives",
"This",
"provides",
"easy",
"translation",
"to",
"switch",
"Angul... | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/core/services/layout/layout.js#L254-L295 | train | Adds an attribute with observe function to the element. | [
30522,
3853,
17961,
24415,
16429,
8043,
3726,
1006,
2465,
18442,
1007,
1063,
2709,
1031,
1005,
1002,
9108,
21823,
2140,
1005,
1010,
1005,
1002,
6970,
18155,
3686,
1005,
1010,
1000,
1002,
8833,
1000,
1010,
3853,
1006,
1035,
1002,
9108,
21823... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-echarts | src/chart/sankey/sankeyLayout.js | scaleNodeBreadths | function scaleNodeBreadths(nodes, kx, orient) {
zrUtil.each(nodes, function (node) {
var nodeDepth = node.getLayout().depth * kx;
orient === 'vertical'
? node.setLayout({y: nodeDepth}, true)
: node.setLayout({x: nodeDepth}, true);
});
} | javascript | function scaleNodeBreadths(nodes, kx, orient) {
zrUtil.each(nodes, function (node) {
var nodeDepth = node.getLayout().depth * kx;
orient === 'vertical'
? node.setLayout({y: nodeDepth}, true)
: node.setLayout({x: nodeDepth}, true);
});
} | [
"function",
"scaleNodeBreadths",
"(",
"nodes",
",",
"kx",
",",
"orient",
")",
"{",
"zrUtil",
".",
"each",
"(",
"nodes",
",",
"function",
"(",
"node",
")",
"{",
"var",
"nodeDepth",
"=",
"node",
".",
"getLayout",
"(",
")",
".",
"depth",
"*",
"kx",
";",... | Scale node x-position to the width
@param {module:echarts/data/Graph~Node} nodes node of sankey view
@param {number} kx multiple used to scale nodes | [
"Scale",
"node",
"x",
"-",
"position",
"to",
"the",
"width"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/sankey/sankeyLayout.js#L239-L246 | train | Scale the nodes breadths | [
30522,
3853,
4094,
3630,
3207,
27035,
26830,
1006,
14164,
1010,
1047,
2595,
1010,
16865,
1007,
1063,
1062,
22134,
4014,
1012,
2169,
1006,
14164,
1010,
3853,
1006,
13045,
1007,
1063,
13075,
13045,
3207,
13876,
2232,
1027,
13045,
1012,
2131,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
BrainJS/brain.js | dist/neural-network-gpu.js | mse | function mse(errors) {
var sum = 0;
for (var i = 0; i < this.constants.size; i++) {
sum += Math.pow(errors[i], 2);
}
return sum / this.constants.size;
} | javascript | function mse(errors) {
var sum = 0;
for (var i = 0; i < this.constants.size; i++) {
sum += Math.pow(errors[i], 2);
}
return sum / this.constants.size;
} | [
"function",
"mse",
"(",
"errors",
")",
"{",
"var",
"sum",
"=",
"0",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"constants",
".",
"size",
";",
"i",
"++",
")",
"{",
"sum",
"+=",
"Math",
".",
"pow",
"(",
"errors",
"[",
... | mean squared error, reimplemented for GPU | [
"mean",
"squared",
"error",
"reimplemented",
"for",
"GPU"
] | ab09bfc74a0d29d4731dcbdebfa17aeba7f7b1ef | https://github.com/BrainJS/brain.js/blob/ab09bfc74a0d29d4731dcbdebfa17aeba7f7b1ef/dist/neural-network-gpu.js#L521-L527 | train | Returns the error in ms | [
30522,
3853,
5796,
2063,
1006,
10697,
1007,
1063,
13075,
7680,
1027,
1014,
1025,
2005,
1006,
13075,
1045,
1027,
1014,
1025,
1045,
1026,
2023,
1012,
5377,
2015,
1012,
2946,
1025,
1045,
1009,
1009,
1007,
1063,
7680,
1009,
1027,
8785,
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/utils/NodeConnection.js | success | function success() {
self._ws.onclose = function () {
if (self._autoReconnect) {
var $promise = self.connect(true);
self.trigger("close", $promise);
} else {
self._cleanup();
... | javascript | function success() {
self._ws.onclose = function () {
if (self._autoReconnect) {
var $promise = self.connect(true);
self.trigger("close", $promise);
} else {
self._cleanup();
... | [
"function",
"success",
"(",
")",
"{",
"self",
".",
"_ws",
".",
"onclose",
"=",
"function",
"(",
")",
"{",
"if",
"(",
"self",
".",
"_autoReconnect",
")",
"{",
"var",
"$promise",
"=",
"self",
".",
"connect",
"(",
"true",
")",
";",
"self",
".",
"trigg... | Called if we succeed at the final setup | [
"Called",
"if",
"we",
"succeed",
"at",
"the",
"final",
"setup"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/NodeConnection.js#L258-L269 | train | Called when the connection is successful | [
30522,
3853,
3112,
1006,
1007,
1063,
2969,
1012,
1035,
1059,
2015,
1012,
2006,
20464,
9232,
1027,
3853,
1006,
1007,
1063,
2065,
1006,
2969,
1012,
1035,
8285,
2890,
8663,
2638,
6593,
1007,
1063,
13075,
1002,
4872,
1027,
2969,
1012,
7532,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/project/FileTreeViewModel.js | _closeSubtree | function _closeSubtree(directory) {
directory = directory.delete("open");
var children = directory.get("children");
if (children) {
children.keySeq().forEach(function (name) {
var subdir = children.get(name);
if (!isFile(subdir)) {
... | javascript | function _closeSubtree(directory) {
directory = directory.delete("open");
var children = directory.get("children");
if (children) {
children.keySeq().forEach(function (name) {
var subdir = children.get(name);
if (!isFile(subdir)) {
... | [
"function",
"_closeSubtree",
"(",
"directory",
")",
"{",
"directory",
"=",
"directory",
".",
"delete",
"(",
"\"open\"",
")",
";",
"var",
"children",
"=",
"directory",
".",
"get",
"(",
"\"children\"",
")",
";",
"if",
"(",
"children",
")",
"{",
"children",
... | Closes a subtree path, given by an object path.
@param {Immutable.Map} directory Current directory
@return {Immutable.Map} new directory | [
"Closes",
"a",
"subtree",
"path",
"given",
"by",
"an",
"object",
"path",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeViewModel.js#L597-L613 | train | Close the subtree of a directory | [
30522,
3853,
1035,
14572,
12083,
13334,
1006,
14176,
1007,
1063,
14176,
1027,
14176,
1012,
3972,
12870,
1006,
1000,
2330,
1000,
1007,
1025,
13075,
2336,
1027,
14176,
1012,
2131,
1006,
1000,
2336,
1000,
1007,
1025,
2065,
1006,
2336,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js | function (oModelData, oPage, sContentSuffix, oData) {
var that = this;
oModelData.data = DataUtils.formatData(oData, oModelData.fileType);
if (oModelData.fileType) {
return LRepConnector.getContent(oModelData.layer, sContentSuffix, true).then(
that._onContentMetadataReceived.bind(that, oModelData, oP... | javascript | function (oModelData, oPage, sContentSuffix, oData) {
var that = this;
oModelData.data = DataUtils.formatData(oData, oModelData.fileType);
if (oModelData.fileType) {
return LRepConnector.getContent(oModelData.layer, sContentSuffix, true).then(
that._onContentMetadataReceived.bind(that, oModelData, oP... | [
"function",
"(",
"oModelData",
",",
"oPage",
",",
"sContentSuffix",
",",
"oData",
")",
"{",
"var",
"that",
"=",
"this",
";",
"oModelData",
".",
"data",
"=",
"DataUtils",
".",
"formatData",
"(",
"oData",
",",
"oModelData",
".",
"fileType",
")",
";",
"if",... | Handler if content data was received;
Formats the received data into the correct file type and requests the file metadata.
@param {Object} oModelData - model data of current page
@param {Object} oPage - current page used to set display busy mode on/off
@param {Object} sContentSuffix - content suffix for sending the met... | [
"Handler",
"if",
"content",
"data",
"was",
"received",
";",
"Formats",
"the",
"received",
"data",
"into",
"the",
"correct",
"file",
"type",
"and",
"requests",
"the",
"file",
"metadata",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js#L100-L114 | train | This function is called when the content is received from the server | [
30522,
3853,
1006,
18168,
10244,
15150,
2696,
1010,
6728,
4270,
1010,
8040,
28040,
7666,
16093,
8873,
2595,
1010,
1051,
2850,
2696,
1007,
1063,
13075,
2008,
1027,
2023,
1025,
18168,
10244,
15150,
2696,
1012,
2951,
1027,
2951,
21823,
4877,
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.fl/src/sap/ui/fl/Utils.js | function(aPromiseQueue, bThrowError, bAsync) {
if (aPromiseQueue.length === 0) {
if (bAsync) {
return Promise.resolve();
}
return new Utils.FakePromise();
}
var fnPromise = aPromiseQueue.shift();
if (typeof fnPromise === "function") {
try {
var vResult = fnPromise();
} catch (e... | javascript | function(aPromiseQueue, bThrowError, bAsync) {
if (aPromiseQueue.length === 0) {
if (bAsync) {
return Promise.resolve();
}
return new Utils.FakePromise();
}
var fnPromise = aPromiseQueue.shift();
if (typeof fnPromise === "function") {
try {
var vResult = fnPromise();
} catch (e... | [
"function",
"(",
"aPromiseQueue",
",",
"bThrowError",
",",
"bAsync",
")",
"{",
"if",
"(",
"aPromiseQueue",
".",
"length",
"===",
"0",
")",
"{",
"if",
"(",
"bAsync",
")",
"{",
"return",
"Promise",
".",
"resolve",
"(",
")",
";",
"}",
"return",
"new",
"... | Execute the passed asynchronous / synchronous (Utils.FakePromise) functions serialized - one after the other.
By default errors do not break the sequential execution of the queue, but this can be changed with the parameter bThrowError.
Error message will be written in any case.
@param {array.<function>} aPromiseQueue ... | [
"Execute",
"the",
"passed",
"asynchronous",
"/",
"synchronous",
"(",
"Utils",
".",
"FakePromise",
")",
"functions",
"serialized",
"-",
"one",
"after",
"the",
"other",
".",
"By",
"default",
"errors",
"do",
"not",
"break",
"the",
"sequential",
"execution",
"of",... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.fl/src/sap/ui/fl/Utils.js#L1287-L1326 | train | Execute a promise queue | [
30522,
3853,
1006,
19804,
20936,
3366,
4226,
5657,
1010,
18411,
8093,
25114,
29165,
1010,
19021,
6038,
2278,
1007,
1063,
2065,
1006,
19804,
20936,
3366,
4226,
5657,
1012,
3091,
1027,
1027,
1027,
1014,
1007,
1063,
2065,
1006,
19021,
6038,
22... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
nhn/tui.editor | src/js/extensions/table/table.js | _changeWysiwygManagers | function _changeWysiwygManagers(wwComponentManager) {
wwComponentManager.removeManager('table');
wwComponentManager.removeManager('tableSelection');
wwComponentManager.addManager(WwMergedTableManager);
wwComponentManager.addManager(WwMergedTableSelectionManager);
} | javascript | function _changeWysiwygManagers(wwComponentManager) {
wwComponentManager.removeManager('table');
wwComponentManager.removeManager('tableSelection');
wwComponentManager.addManager(WwMergedTableManager);
wwComponentManager.addManager(WwMergedTableSelectionManager);
} | [
"function",
"_changeWysiwygManagers",
"(",
"wwComponentManager",
")",
"{",
"wwComponentManager",
".",
"removeManager",
"(",
"'table'",
")",
";",
"wwComponentManager",
".",
"removeManager",
"(",
"'tableSelection'",
")",
";",
"wwComponentManager",
".",
"addManager",
"(",
... | Change wysiwyg component managers.
@param {object} wwComponentManager - componentMananger instance
@private | [
"Change",
"wysiwyg",
"component",
"managers",
"."
] | e75ab08c2a7ab07d1143e318f7cde135c5e3002e | https://github.com/nhn/tui.editor/blob/e75ab08c2a7ab07d1143e318f7cde135c5e3002e/src/js/extensions/table/table.js#L65-L71 | train | Change the Wysiwyg Manager | [
30522,
3853,
1035,
2689,
18418,
5332,
18418,
25494,
17325,
2015,
1006,
1059,
16526,
25377,
5643,
3372,
24805,
4590,
1007,
1063,
1059,
16526,
25377,
5643,
3372,
24805,
4590,
1012,
6366,
24805,
4590,
1006,
1005,
2795,
1005,
1007,
1025,
1059,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.rta/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js | _isComplexType | function _isComplexType (mProperty) {
if (mProperty && mProperty.type) {
if (mProperty.type.toLowerCase().indexOf("edm") !== 0) {
return true;
}
}
return false;
} | javascript | function _isComplexType (mProperty) {
if (mProperty && mProperty.type) {
if (mProperty.type.toLowerCase().indexOf("edm") !== 0) {
return true;
}
}
return false;
} | [
"function",
"_isComplexType",
"(",
"mProperty",
")",
"{",
"if",
"(",
"mProperty",
"&&",
"mProperty",
".",
"type",
")",
"{",
"if",
"(",
"mProperty",
".",
"type",
".",
"toLowerCase",
"(",
")",
".",
"indexOf",
"(",
"\"edm\"",
")",
"!==",
"0",
")",
"{",
... | Is field using a complex type
@param {Object} mProperty - property from entityType
@returns {Boolean} - Returns true if property is using a complex type | [
"Is",
"field",
"using",
"a",
"complex",
"type"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js#L52-L59 | train | Check if the property is a complex type | [
30522,
3853,
1035,
2003,
9006,
19386,
13874,
1006,
6131,
18981,
15010,
1007,
1063,
2065,
1006,
6131,
18981,
15010,
1004,
1004,
6131,
18981,
15010,
1012,
2828,
1007,
1063,
2065,
1006,
6131,
18981,
15010,
1012,
2828,
1012,
2000,
27663,
18992,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Freeboard/freeboard | js/freeboard.thirdparty.js | function(event) {
var date,
inst = $.datepicker._getInst(event.target);
if (inst.input.val() !== inst.lastVal) {
try {
date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
(inst.input ? inst.input.val() : null),
$.datepicker._getFormatConfig(inst));
if (date) { // only if v... | javascript | function(event) {
var date,
inst = $.datepicker._getInst(event.target);
if (inst.input.val() !== inst.lastVal) {
try {
date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
(inst.input ? inst.input.val() : null),
$.datepicker._getFormatConfig(inst));
if (date) { // only if v... | [
"function",
"(",
"event",
")",
"{",
"var",
"date",
",",
"inst",
"=",
"$",
".",
"datepicker",
".",
"_getInst",
"(",
"event",
".",
"target",
")",
";",
"if",
"(",
"inst",
".",
"input",
".",
"val",
"(",
")",
"!==",
"inst",
".",
"lastVal",
")",
"{",
... | /* Synchronise manual entry and field/alternate field. | [
"/",
"*",
"Synchronise",
"manual",
"entry",
"and",
"field",
"/",
"alternate",
"field",
"."
] | 38789f6e8bd3d04f7d3b2c3427e509d00f2610fc | https://github.com/Freeboard/freeboard/blob/38789f6e8bd3d04f7d3b2c3427e509d00f2610fc/js/freeboard.thirdparty.js#L8271-L8291 | train | This function is called when the date field is changed | [
30522,
3853,
1006,
2724,
1007,
1063,
13075,
3058,
1010,
16021,
2102,
1027,
1002,
1012,
3058,
24330,
5484,
1012,
1035,
2131,
7076,
2102,
1006,
2724,
1012,
4539,
1007,
1025,
2065,
1006,
16021,
2102,
1012,
7953,
1012,
11748,
1006,
1007,
999,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
aframevr/aframe | src/components/raycaster.js | function () {
var data = this.data;
var els;
// If objects not defined, intersect with everything.
els = data.objects
? this.el.sceneEl.querySelectorAll(data.objects)
: this.el.sceneEl.querySelectorAll('*');
this.objects = this.flattenObject3DMaps(els);
this.dirty = false;
} | javascript | function () {
var data = this.data;
var els;
// If objects not defined, intersect with everything.
els = data.objects
? this.el.sceneEl.querySelectorAll(data.objects)
: this.el.sceneEl.querySelectorAll('*');
this.objects = this.flattenObject3DMaps(els);
this.dirty = false;
} | [
"function",
"(",
")",
"{",
"var",
"data",
"=",
"this",
".",
"data",
";",
"var",
"els",
";",
"// If objects not defined, intersect with everything.",
"els",
"=",
"data",
".",
"objects",
"?",
"this",
".",
"el",
".",
"sceneEl",
".",
"querySelectorAll",
"(",
"da... | Update list of objects to test for intersection. | [
"Update",
"list",
"of",
"objects",
"to",
"test",
"for",
"intersection",
"."
] | 24acc78a7299a4cdfe3ef617f4d40ddf6275c992 | https://github.com/aframevr/aframe/blob/24acc78a7299a4cdfe3ef617f4d40ddf6275c992/src/components/raycaster.js#L172-L182 | train | flatten objects in the object3D map | [
30522,
3853,
1006,
1007,
1063,
13075,
2951,
1027,
2023,
1012,
2951,
1025,
13075,
3449,
2015,
1025,
1013,
1013,
2065,
5200,
2025,
4225,
1010,
29261,
2007,
2673,
1012,
3449,
2015,
1027,
2951,
1012,
30524,
2023,
1012,
3449,
1012,
3496,
2884,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
lovell/sharp | lib/output.js | _pipeline | function _pipeline (callback) {
const that = this;
if (typeof callback === 'function') {
// output=file/buffer
if (this._isStreamInput()) {
// output=file/buffer, input=stream
this.on('finish', function () {
that._flattenBufferIn();
sharp.pipeline(that.options, callback);
}... | javascript | function _pipeline (callback) {
const that = this;
if (typeof callback === 'function') {
// output=file/buffer
if (this._isStreamInput()) {
// output=file/buffer, input=stream
this.on('finish', function () {
that._flattenBufferIn();
sharp.pipeline(that.options, callback);
}... | [
"function",
"_pipeline",
"(",
"callback",
")",
"{",
"const",
"that",
"=",
"this",
";",
"if",
"(",
"typeof",
"callback",
"===",
"'function'",
")",
"{",
"// output=file/buffer",
"if",
"(",
"this",
".",
"_isStreamInput",
"(",
")",
")",
"{",
"// output=file/buff... | Invoke the C++ image processing pipeline
Supports callback, stream and promise variants
@private | [
"Invoke",
"the",
"C",
"++",
"image",
"processing",
"pipeline",
"Supports",
"callback",
"stream",
"and",
"promise",
"variants"
] | 05d76eeadfe54713606a615185b2da047923406b | https://github.com/lovell/sharp/blob/05d76eeadfe54713606a615185b2da047923406b/lib/output.js#L613-L707 | train | Pipes the image into a single file | [
30522,
3853,
1035,
13117,
1006,
2655,
5963,
1007,
1063,
9530,
3367,
2008,
1027,
2023,
1025,
2065,
1006,
2828,
11253,
2655,
5963,
1027,
1027,
1027,
1005,
3853,
1005,
1007,
1063,
1013,
1013,
6434,
1027,
5371,
1013,
17698,
2065,
1006,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
TryGhost/Ghost | core/server/services/apps/loader.js | function (name) {
const {app, proxy} = getAppByName(name);
// Check for an activate() method on the app.
if (!_.isFunction(app.activate)) {
return Promise.reject(new Error(common.i18n.t('errors.apps.noActivateMethodLoadingApp.error', {name: name})));
}
// Wrapping t... | javascript | function (name) {
const {app, proxy} = getAppByName(name);
// Check for an activate() method on the app.
if (!_.isFunction(app.activate)) {
return Promise.reject(new Error(common.i18n.t('errors.apps.noActivateMethodLoadingApp.error', {name: name})));
}
// Wrapping t... | [
"function",
"(",
"name",
")",
"{",
"const",
"{",
"app",
",",
"proxy",
"}",
"=",
"getAppByName",
"(",
"name",
")",
";",
"// Check for an activate() method on the app.",
"if",
"(",
"!",
"_",
".",
"isFunction",
"(",
"app",
".",
"activate",
")",
")",
"{",
"r... | Activate a app and return it | [
"Activate",
"a",
"app",
"and",
"return",
"it"
] | bb7bb55cf3e60af99ebbc56099928827b58461bc | https://github.com/TryGhost/Ghost/blob/bb7bb55cf3e60af99ebbc56099928827b58461bc/core/server/services/apps/loader.js#L33-L44 | train | Load an app | [
30522,
3853,
1006,
2171,
1007,
1063,
9530,
3367,
1063,
10439,
1010,
24540,
1065,
1027,
2131,
29098,
3762,
18442,
1006,
2171,
1007,
1025,
1013,
1013,
4638,
2005,
2019,
20544,
1006,
1007,
4118,
2006,
1996,
10439,
1012,
2065,
1006,
999,
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... | |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/addons.js | addonsManager_getAddonRadiogroup | function addonsManager_getAddonRadiogroup(aSpec) {
var spec = aSpec || { };
var addon = spec.addon;
var radiogroup = spec.radiogroup;
if (!radiogroup)
throw new Error(arguments.callee.name + ": Radiogroup not specified.");
return this.getAddonChildElement({addon: addon, type: radiogroup + "R... | javascript | function addonsManager_getAddonRadiogroup(aSpec) {
var spec = aSpec || { };
var addon = spec.addon;
var radiogroup = spec.radiogroup;
if (!radiogroup)
throw new Error(arguments.callee.name + ": Radiogroup not specified.");
return this.getAddonChildElement({addon: addon, type: radiogroup + "R... | [
"function",
"addonsManager_getAddonRadiogroup",
"(",
"aSpec",
")",
"{",
"var",
"spec",
"=",
"aSpec",
"||",
"{",
"}",
";",
"var",
"addon",
"=",
"spec",
".",
"addon",
";",
"var",
"radiogroup",
"=",
"spec",
".",
"radiogroup",
";",
"if",
"(",
"!",
"radiogrou... | Returns the element of the specified add-ons radio group
@param {object} aSpec
Information on which add-on to operate on
Elements: addon - Add-on element
radiogroup - Radiogroup
Detail View (autoUpdate)
@returns Add-on radiogroup
@type {ElemBase} | [
"Returns",
"the",
"element",
"of",
"the",
"specified",
"add",
"-",
"ons",
"radio",
"group"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/addons.js#L507-L516 | train | Get the element of the specified add - ons radiogroup | [
30522,
3853,
5587,
5644,
24805,
4590,
1035,
2131,
4215,
5280,
12173,
3695,
17058,
1006,
2004,
5051,
2278,
1007,
1063,
13075,
28699,
1027,
2004,
5051,
2278,
1064,
1064,
1063,
1065,
1025,
13075,
5587,
2239,
1027,
28699,
1012,
5587,
2239,
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... |
fex-team/webuploader | dist/webuploader.withoutimage.js | WUFile | function WUFile( source ) {
/**
* 文件名,包括扩展名(后缀)
* @property name
* @type {string}
*/
this.name = source.name || 'Untitled';
/**
* 文件体积(字节)
* @property size
* @type {uint}
... | javascript | function WUFile( source ) {
/**
* 文件名,包括扩展名(后缀)
* @property name
* @type {string}
*/
this.name = source.name || 'Untitled';
/**
* 文件体积(字节)
* @property size
* @type {uint}
... | [
"function",
"WUFile",
"(",
"source",
")",
"{",
"/**\n * 文件名,包括扩展名(后缀)\n * @property name\n * @type {string}\n */",
"this",
".",
"name",
"=",
"source",
".",
"name",
"||",
"'Untitled'",
";",
"/**\n * 文件体积(字节)\n *... | 文件类
@class File
@constructor 构造函数
@grammar new File( source ) => File
@param {Lib.File} source [lib.File](#Lib.File)实例, 此source对象是带有Runtime信息的。 | [
"文件类"
] | 7094e4476c5af3b06993d91dde2d223200b9feb7 | https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/dist/webuploader.withoutimage.js#L1978-L2042 | train | WUFile constructor. | [
30522,
3853,
8814,
8873,
2571,
1006,
3120,
1007,
1063,
1013,
1008,
1008,
1008,
1861,
100,
1795,
1989,
100,
100,
100,
100,
1795,
1987,
100,
100,
1988,
1008,
1030,
3200,
2171,
1008,
1030,
2828,
1063,
5164,
1065,
1008,
1013,
2023,
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... |
grpc/grpc | examples/node/static_codegen/greeter_server.js | sayHello | function sayHello(call, callback) {
var reply = new messages.HelloReply();
reply.setMessage('Hello ' + call.request.getName());
callback(null, reply);
} | javascript | function sayHello(call, callback) {
var reply = new messages.HelloReply();
reply.setMessage('Hello ' + call.request.getName());
callback(null, reply);
} | [
"function",
"sayHello",
"(",
"call",
",",
"callback",
")",
"{",
"var",
"reply",
"=",
"new",
"messages",
".",
"HelloReply",
"(",
")",
";",
"reply",
".",
"setMessage",
"(",
"'Hello '",
"+",
"call",
".",
"request",
".",
"getName",
"(",
")",
")",
";",
"c... | Implements the SayHello RPC method. | [
"Implements",
"the",
"SayHello",
"RPC",
"method",
"."
] | cc75d93818410e2b0edd0fa3009a6def9ac403ca | https://github.com/grpc/grpc/blob/cc75d93818410e2b0edd0fa3009a6def9ac403ca/examples/node/static_codegen/greeter_server.js#L27-L31 | train | sayHello - Sends a message to the client | [
30522,
3853,
2360,
18223,
2080,
1006,
2655,
1010,
2655,
5963,
1007,
1063,
13075,
7514,
1027,
2047,
7696,
1012,
7592,
2890,
22086,
1006,
1007,
1025,
7514,
1012,
2275,
7834,
3736,
3351,
1006,
1005,
7592,
1005,
1009,
2655,
1012,
5227,
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... |
postcss/autoprefixer | lib/prefixer.js | clone | function clone (obj, parent) {
let cloned = new obj.constructor()
for (let i of Object.keys(obj || {})) {
let value = obj[i]
if (i === 'parent' && typeof value === 'object') {
if (parent) {
cloned[i] = parent
}
} else if (i === 'source' || i === null) {
cloned[i] = value
}... | javascript | function clone (obj, parent) {
let cloned = new obj.constructor()
for (let i of Object.keys(obj || {})) {
let value = obj[i]
if (i === 'parent' && typeof value === 'object') {
if (parent) {
cloned[i] = parent
}
} else if (i === 'source' || i === null) {
cloned[i] = value
}... | [
"function",
"clone",
"(",
"obj",
",",
"parent",
")",
"{",
"let",
"cloned",
"=",
"new",
"obj",
".",
"constructor",
"(",
")",
"for",
"(",
"let",
"i",
"of",
"Object",
".",
"keys",
"(",
"obj",
"||",
"{",
"}",
")",
")",
"{",
"let",
"value",
"=",
"ob... | Recursively clone objects | [
"Recursively",
"clone",
"objects"
] | 24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32 | https://github.com/postcss/autoprefixer/blob/24b28b6dbdc34a5e5800986e76f48cbaf9bbbc32/lib/prefixer.js#L9-L31 | train | Clone an object | [
30522,
3853,
17598,
1006,
27885,
3501,
1010,
6687,
1007,
1063,
2292,
17598,
2094,
1027,
2047,
27885,
3501,
1012,
9570,
2953,
1006,
1007,
2005,
1006,
2292,
1045,
1997,
4874,
1012,
6309,
1006,
27885,
3501,
1064,
1064,
1063,
1065,
1007,
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.table/src/sap/ui/table/library.support.js | checkColumnTemplate | function checkColumnTemplate(fnDoCheck, oScope, sType) {
var aTables = SupportHelper.find(oScope, true, "sap.ui.table.Table");
var aColumns, oTemplate;
for (var i = 0; i < aTables.length; i++) {
aColumns = aTables[i].getColumns();
for (var k = 0; k < aColumns.length; k++) {
oTemplate = aColumns[k].getTe... | javascript | function checkColumnTemplate(fnDoCheck, oScope, sType) {
var aTables = SupportHelper.find(oScope, true, "sap.ui.table.Table");
var aColumns, oTemplate;
for (var i = 0; i < aTables.length; i++) {
aColumns = aTables[i].getColumns();
for (var k = 0; k < aColumns.length; k++) {
oTemplate = aColumns[k].getTe... | [
"function",
"checkColumnTemplate",
"(",
"fnDoCheck",
",",
"oScope",
",",
"sType",
")",
"{",
"var",
"aTables",
"=",
"SupportHelper",
".",
"find",
"(",
"oScope",
",",
"true",
",",
"\"sap.ui.table.Table\"",
")",
";",
"var",
"aColumns",
",",
"oTemplate",
";",
"f... | ********************************************************** Helpers related to sap.ui.table Controls **********************************************************
Loops over all columns of all visible tables and calls the given callback with the following parameters:
table instance, column instance, column template instan... | [
"**********************************************************",
"Helpers",
"related",
"to",
"sap",
".",
"ui",
".",
"table",
"Controls",
"**********************************************************",
"Loops",
"over",
"all",
"columns",
"of",
"all",
"visible",
"tables",
"and",
"cal... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/library.support.js#L53-L65 | train | Checks if the template of the columns of the table is a type | [
30522,
3853,
4638,
25778,
2819,
10111,
8737,
13806,
1006,
1042,
15482,
5403,
3600,
1010,
9808,
16186,
1010,
2358,
18863,
1007,
1063,
13075,
29533,
13510,
1027,
2490,
16001,
4842,
1012,
2424,
1006,
9808,
16186,
1010,
2995,
1010,
1000,
20066,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/command/KeyBindingManager.js | _handleKeyEvent | function _handleKeyEvent(event) {
var i, handled = false;
for (i = _globalKeydownHooks.length - 1; i >= 0; i--) {
if (_globalKeydownHooks[i](event)) {
handled = true;
break;
}
}
_detectAltGrKeyDown(event);
if (!handled && _h... | javascript | function _handleKeyEvent(event) {
var i, handled = false;
for (i = _globalKeydownHooks.length - 1; i >= 0; i--) {
if (_globalKeydownHooks[i](event)) {
handled = true;
break;
}
}
_detectAltGrKeyDown(event);
if (!handled && _h... | [
"function",
"_handleKeyEvent",
"(",
"event",
")",
"{",
"var",
"i",
",",
"handled",
"=",
"false",
";",
"for",
"(",
"i",
"=",
"_globalKeydownHooks",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"if",
"(",
"_globalKeydownHooks... | Handles a given keydown event, checking global hooks first before
deciding to handle it ourselves.
@param {Event} The keydown event to handle. | [
"Handles",
"a",
"given",
"keydown",
"event",
"checking",
"global",
"hooks",
"first",
"before",
"deciding",
"to",
"handle",
"it",
"ourselves",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/KeyBindingManager.js#L976-L989 | train | Handle keydown events | [
30522,
3853,
1035,
5047,
14839,
18697,
3372,
1006,
2724,
1007,
1063,
13075,
1045,
1010,
8971,
1027,
6270,
1025,
2005,
1006,
1045,
1027,
1035,
3795,
14839,
7698,
6806,
6559,
2015,
1012,
3091,
1011,
1015,
1025,
1045,
1028,
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... |
angular/material | src/components/menu/js/menuServiceProvider.js | showBackdrop | function showBackdrop(scope, element, options) {
if (options.nestLevel) return angular.noop;
// If we are not within a dialog...
if (options.disableParentScroll && !$mdUtil.getClosest(options.target, 'MD-DIALOG')) {
// !! DO this before creating the backdrop; since disableScrollAround()
... | javascript | function showBackdrop(scope, element, options) {
if (options.nestLevel) return angular.noop;
// If we are not within a dialog...
if (options.disableParentScroll && !$mdUtil.getClosest(options.target, 'MD-DIALOG')) {
// !! DO this before creating the backdrop; since disableScrollAround()
... | [
"function",
"showBackdrop",
"(",
"scope",
",",
"element",
",",
"options",
")",
"{",
"if",
"(",
"options",
".",
"nestLevel",
")",
"return",
"angular",
".",
"noop",
";",
"// If we are not within a dialog...",
"if",
"(",
"options",
".",
"disableParentScroll",
"&&",... | Show modal backdrop element...
@returns {function(): void} A function that removes this backdrop | [
"Show",
"modal",
"backdrop",
"element",
"..."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/menu/js/menuServiceProvider.js#L47-L72 | train | Show the backdrop | [
30522,
3853,
2265,
5963,
25711,
1006,
9531,
1010,
5783,
1010,
7047,
1007,
1063,
2065,
1006,
7047,
1012,
9089,
20414,
2884,
1007,
2709,
16108,
1012,
2053,
7361,
1025,
1013,
1013,
2065,
2057,
2024,
2025,
2306,
1037,
13764,
8649,
1012,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-echarts | src/chart/custom.js | style | function style(extra, dataIndexInside) {
dataIndexInside == null && (dataIndexInside = currDataIndexInside);
updateCache(dataIndexInside);
var itemStyle = currItemModel.getModel(ITEM_STYLE_NORMAL_PATH).getItemStyle();
currVisualColor != null && (itemStyle.fill = currVisualColor);
... | javascript | function style(extra, dataIndexInside) {
dataIndexInside == null && (dataIndexInside = currDataIndexInside);
updateCache(dataIndexInside);
var itemStyle = currItemModel.getModel(ITEM_STYLE_NORMAL_PATH).getItemStyle();
currVisualColor != null && (itemStyle.fill = currVisualColor);
... | [
"function",
"style",
"(",
"extra",
",",
"dataIndexInside",
")",
"{",
"dataIndexInside",
"==",
"null",
"&&",
"(",
"dataIndexInside",
"=",
"currDataIndexInside",
")",
";",
"updateCache",
"(",
"dataIndexInside",
")",
";",
"var",
"itemStyle",
"=",
"currItemModel",
"... | By default, `visual` is applied to style (to support visualMap).
`visual.color` is applied at `fill`. If user want apply visual.color on `stroke`,
it can be implemented as:
`api.style({stroke: api.visual('color'), fill: null})`;
@public
@param {Object} [extra]
@param {number} [dataIndexInside=currDataIndexInside] | [
"By",
"default",
"visual",
"is",
"applied",
"to",
"style",
"(",
"to",
"support",
"visualMap",
")",
".",
"visual",
".",
"color",
"is",
"applied",
"at",
"fill",
".",
"If",
"user",
"want",
"apply",
"visual",
".",
"color",
"on",
"stroke",
"it",
"can",
"be"... | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/chart/custom.js#L444-L468 | train | Returns the style for the item | [
30522,
3853,
2806,
1006,
4469,
1010,
2951,
22254,
10288,
7076,
5178,
1007,
1063,
2951,
22254,
10288,
7076,
5178,
1027,
1027,
19701,
1004,
1004,
1006,
2951,
22254,
10288,
7076,
5178,
1027,
12731,
12171,
2850,
18249,
3207,
20303,
7363,
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... |
MithrilJS/mithril.js | render/render.js | updateNodes | function updateNodes(parent, old, vnodes, hooks, nextSibling, ns) {
if (old === vnodes || old == null && vnodes == null) return
else if (old == null || old.length === 0) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, ns)
else if (vnodes == null || vnodes.length === 0) removeNodes(old, 0, old.le... | javascript | function updateNodes(parent, old, vnodes, hooks, nextSibling, ns) {
if (old === vnodes || old == null && vnodes == null) return
else if (old == null || old.length === 0) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, ns)
else if (vnodes == null || vnodes.length === 0) removeNodes(old, 0, old.le... | [
"function",
"updateNodes",
"(",
"parent",
",",
"old",
",",
"vnodes",
",",
"hooks",
",",
"nextSibling",
",",
"ns",
")",
"{",
"if",
"(",
"old",
"===",
"vnodes",
"||",
"old",
"==",
"null",
"&&",
"vnodes",
"==",
"null",
")",
"return",
"else",
"if",
"(",
... | ## DOM node moves In most scenarios `updateNode()` and `createNode()` perform the DOM operations. However, this is not the case if the node moved (second and fourth part of the diff algo). We move the old DOM nodes before updateNode runs because it enables us to use the cached `nextSibling` variable rather than fetchi... | [
"##",
"DOM",
"node",
"moves",
"In",
"most",
"scenarios",
"updateNode",
"()",
"and",
"createNode",
"()",
"perform",
"the",
"DOM",
"operations",
".",
"However",
"this",
"is",
"not",
"the",
"case",
"if",
"the",
"node",
"moved",
"(",
"second",
"and",
"fourth",... | 6d36fe09d129928c6b460720e08d9ed321fcd62b | https://github.com/MithrilJS/mithril.js/blob/6d36fe09d129928c6b460720e08d9ed321fcd62b/render/render.js#L277-L434 | train | Updates the nodes in the node list. | [
30522,
3853,
10651,
3630,
6155,
1006,
6687,
1010,
2214,
1010,
1058,
3630,
6155,
1010,
18008,
1010,
2279,
5332,
9709,
1010,
24978,
1007,
1063,
2065,
1006,
2214,
1027,
1027,
1027,
1058,
3630,
6155,
1064,
1064,
2214,
1027,
1027,
19701,
1004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
heyui/heyui | src/plugins/popper/index.js | setAttributes | function setAttributes(element, attributes) {
Object.keys(attributes).forEach(function (prop) {
var value = attributes[prop];
if (value !== false) {
element.setAttribute(prop, attributes[prop]);
} else {
element.removeAttribute(prop);
}
});
} | javascript | function setAttributes(element, attributes) {
Object.keys(attributes).forEach(function (prop) {
var value = attributes[prop];
if (value !== false) {
element.setAttribute(prop, attributes[prop]);
} else {
element.removeAttribute(prop);
}
});
} | [
"function",
"setAttributes",
"(",
"element",
",",
"attributes",
")",
"{",
"Object",
".",
"keys",
"(",
"attributes",
")",
".",
"forEach",
"(",
"function",
"(",
"prop",
")",
"{",
"var",
"value",
"=",
"attributes",
"[",
"prop",
"]",
";",
"if",
"(",
"value... | Set the attributes to the given popper
@method
@memberof Popper.Utils
@argument {Element} element - Element to apply the attributes to
@argument {Object} styles
Object with a list of properties and values which will be applied to the element | [
"Set",
"the",
"attributes",
"to",
"the",
"given",
"popper"
] | d5405d27d994151b676eb91c12b389316d7f6679 | https://github.com/heyui/heyui/blob/d5405d27d994151b676eb91c12b389316d7f6679/src/plugins/popper/index.js#L1192-L1201 | train | Set attributes on an element | [
30522,
30524,
19321,
3089,
8569,
2618,
1006,
17678,
1010,
12332,
1031,
17678,
1033,
1007,
1025,
1065,
2842,
1063,
5783,
1012,
6366,
19321,
3089,
8569,
2618,
1006,
17678,
1007,
1025,
1065,
1065,
1007,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ngrx/platform | projects/ngrx.io/tools/examples/run-example-e2e.js | spawnExt | function spawnExt(command, args, options, ignoreClose = false) {
let proc;
const promise = new Promise((resolve, reject) => {
let descr = command + ' ' + args.join(' ');
console.log('running: ' + descr);
try {
proc = xSpawn.spawn(command, args, options);
} catch (e) {
console.log(e);
... | javascript | function spawnExt(command, args, options, ignoreClose = false) {
let proc;
const promise = new Promise((resolve, reject) => {
let descr = command + ' ' + args.join(' ');
console.log('running: ' + descr);
try {
proc = xSpawn.spawn(command, args, options);
} catch (e) {
console.log(e);
... | [
"function",
"spawnExt",
"(",
"command",
",",
"args",
",",
"options",
",",
"ignoreClose",
"=",
"false",
")",
"{",
"let",
"proc",
";",
"const",
"promise",
"=",
"new",
"Promise",
"(",
"(",
"resolve",
",",
"reject",
")",
"=>",
"{",
"let",
"descr",
"=",
"... | Returns both a promise and the spawned process so that it can be killed if needed. | [
"Returns",
"both",
"a",
"promise",
"and",
"the",
"spawned",
"process",
"so",
"that",
"it",
"can",
"be",
"killed",
"if",
"needed",
"."
] | eec9cc615440526ddedac04ae0082bfecef13d50 | https://github.com/ngrx/platform/blob/eec9cc615440526ddedac04ae0082bfecef13d50/projects/ngrx.io/tools/examples/run-example-e2e.js#L246-L277 | train | Spawns an external process | [
30522,
3853,
25645,
10288,
2102,
1006,
3094,
1010,
12098,
5620,
1010,
7047,
1010,
8568,
20464,
9232,
1027,
6270,
1007,
1063,
2292,
4013,
2278,
1025,
9530,
3367,
4872,
1027,
2047,
4872,
1006,
1006,
10663,
1010,
15454,
1007,
1027,
1028,
1063,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jgraph/mxgraph | javascript/mxClient.js | function(basename, lan)
{
if (mxClient.languages == null || !this.isLanguageSupported(lan))
{
var dash = lan.indexOf('-');
if (dash > 0)
{
lan = lan.substring(0, dash);
}
}
if (mxResources.loadSpecialBundle && mxResources.isLanguageSupported(lan) && lan != mxClient.defaultLanguage)
{
... | javascript | function(basename, lan)
{
if (mxClient.languages == null || !this.isLanguageSupported(lan))
{
var dash = lan.indexOf('-');
if (dash > 0)
{
lan = lan.substring(0, dash);
}
}
if (mxResources.loadSpecialBundle && mxResources.isLanguageSupported(lan) && lan != mxClient.defaultLanguage)
{
... | [
"function",
"(",
"basename",
",",
"lan",
")",
"{",
"if",
"(",
"mxClient",
".",
"languages",
"==",
"null",
"||",
"!",
"this",
".",
"isLanguageSupported",
"(",
"lan",
")",
")",
"{",
"var",
"dash",
"=",
"lan",
".",
"indexOf",
"(",
"'-'",
")",
";",
"if... | Function: getSpecialBundle
Hook for subclassers to return the URL for the special bundle. This
implementation returns basename + '_' + lan + <extension> or null if
<loadSpecialBundle> is false or lan equals <mxClient.defaultLanguage>.
If <mxResources.languages> is not null and <mxClient.language> contains
a dash, the... | [
"Function",
":",
"getSpecialBundle"
] | 33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44 | https://github.com/jgraph/mxgraph/blob/33911ed7e055c17b74d0367f5f1f6c9ee4b4fd44/javascript/mxClient.js#L1401-L1421 | train | Returns the name of the bundle for the given language | [
30522,
3853,
1006,
2918,
18442,
1010,
17595,
1007,
1063,
2065,
1006,
25630,
20464,
11638,
1012,
4155,
1027,
1027,
19701,
1064,
1064,
999,
2023,
1012,
25340,
3070,
6692,
8449,
6279,
6442,
2098,
1006,
17595,
1007,
1007,
1063,
13075,
11454,
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... | |
ReactTraining/react-router | packages/react-router-dom/modules/NavLink.js | NavLink | function NavLink({
"aria-current": ariaCurrent = "page",
activeClassName = "active",
activeStyle,
className: classNameProp,
exact,
isActive: isActiveProp,
location,
strict,
style: styleProp,
to,
...rest
}) {
const path = typeof to === "object" ? to.pathname : to;
// Regex taken from: https://... | javascript | function NavLink({
"aria-current": ariaCurrent = "page",
activeClassName = "active",
activeStyle,
className: classNameProp,
exact,
isActive: isActiveProp,
location,
strict,
style: styleProp,
to,
...rest
}) {
const path = typeof to === "object" ? to.pathname : to;
// Regex taken from: https://... | [
"function",
"NavLink",
"(",
"{",
"\"aria-current\"",
":",
"ariaCurrent",
"=",
"\"page\"",
",",
"activeClassName",
"=",
"\"active\"",
",",
"activeStyle",
",",
"className",
":",
"classNameProp",
",",
"exact",
",",
"isActive",
":",
"isActiveProp",
",",
"location",
... | A <Link> wrapper that knows if it's "active" or not. | [
"A",
"<Link",
">",
"wrapper",
"that",
"knows",
"if",
"it",
"s",
"active",
"or",
"not",
"."
] | 82ce94c3b4e74f71018d104df6dc999801fa9ab2 | https://github.com/ReactTraining/react-router/blob/82ce94c3b4e74f71018d104df6dc999801fa9ab2/packages/react-router-dom/modules/NavLink.js#L14-L60 | train | Link to a page | [
30522,
3853,
6583,
2615,
13767,
1006,
1063,
1000,
9342,
1011,
2783,
1000,
1024,
9342,
10841,
14343,
3372,
1027,
1000,
3931,
1000,
1010,
3161,
26266,
18442,
1027,
1000,
3161,
1000,
1010,
3161,
21756,
2571,
1010,
2465,
18442,
1024,
2465,
1844... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adobe/brackets | src/extensions/default/CodeFolding/main.js | saveLineFolds | function saveLineFolds(editor) {
var saveFolds = prefs.getSetting("saveFoldStates");
if (!editor || !saveFolds) {
return;
}
var folds = editor._codeMirror._lineFolds || {};
var path = editor.document.file.fullPath;
if (Object.keys(folds).length) {
... | javascript | function saveLineFolds(editor) {
var saveFolds = prefs.getSetting("saveFoldStates");
if (!editor || !saveFolds) {
return;
}
var folds = editor._codeMirror._lineFolds || {};
var path = editor.document.file.fullPath;
if (Object.keys(folds).length) {
... | [
"function",
"saveLineFolds",
"(",
"editor",
")",
"{",
"var",
"saveFolds",
"=",
"prefs",
".",
"getSetting",
"(",
"\"saveFoldStates\"",
")",
";",
"if",
"(",
"!",
"editor",
"||",
"!",
"saveFolds",
")",
"{",
"return",
";",
"}",
"var",
"folds",
"=",
"editor",... | Saves the line folds in the editor using the preference storage
@param {Editor} editor the editor whose line folds should be saved | [
"Saves",
"the",
"line",
"folds",
"in",
"the",
"editor",
"using",
"the",
"preference",
"storage"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/main.js#L159-L171 | train | Save line folds to the editor | [
30522,
3853,
3828,
4179,
10371,
2015,
1006,
3559,
1007,
1063,
13075,
3828,
10371,
2015,
1027,
3653,
10343,
1012,
4152,
18319,
3070,
1006,
1000,
3828,
10371,
9153,
4570,
1000,
1007,
1025,
2065,
1006,
999,
3559,
1064,
1064,
999,
3828,
10371,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/component/axis/ParallelAxisView.js | function (
builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api
) {
// After filtering, axis may change, select area needs to be update.
var extent = axisModel.axis.getExtent();
var extentLen = extent[1] - extent[0];
var extra = Math.min(30, Math.abs(extentLe... | javascript | function (
builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api
) {
// After filtering, axis may change, select area needs to be update.
var extent = axisModel.axis.getExtent();
var extentLen = extent[1] - extent[0];
var extra = Math.min(30, Math.abs(extentLe... | [
"function",
"(",
"builderOpt",
",",
"areaSelectStyle",
",",
"axisModel",
",",
"coordSysModel",
",",
"areaWidth",
",",
"api",
")",
"{",
"// After filtering, axis may change, select area needs to be update.",
"var",
"extent",
"=",
"axisModel",
".",
"axis",
".",
"getExtent... | /** * @override updateVisual: function (axisModel, ecModel, api, payload) { this._brushController && this._brushController .updateCovers(getCoverInfoList(axisModel)); }, | [
"/",
"**",
"*"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/component/axis/ParallelAxisView.js#L103-L140 | train | Update the region of the region | [
30522,
3853,
1006,
12508,
7361,
2102,
1010,
2752,
12260,
16649,
27983,
1010,
8123,
5302,
9247,
1010,
2522,
8551,
6508,
25855,
9247,
1010,
2181,
9148,
11927,
2232,
1010,
17928,
1007,
1063,
1013,
1013,
2044,
22910,
1010,
8123,
2089,
2689,
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... | |
cypress-io/cypress | packages/server/lib/util/net_profiler.js | NetProfiler | function NetProfiler (options = {}) {
if (!(this instanceof NetProfiler)) return new NetProfiler(options)
if (!options.net) {
options.net = require('net')
}
this.net = options.net
this.proxies = {}
this.activeConnections = []
this.startTs = new Date() / 1000
this.tickMs = options.tickMs || 1000
... | javascript | function NetProfiler (options = {}) {
if (!(this instanceof NetProfiler)) return new NetProfiler(options)
if (!options.net) {
options.net = require('net')
}
this.net = options.net
this.proxies = {}
this.activeConnections = []
this.startTs = new Date() / 1000
this.tickMs = options.tickMs || 1000
... | [
"function",
"NetProfiler",
"(",
"options",
"=",
"{",
"}",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"NetProfiler",
")",
")",
"return",
"new",
"NetProfiler",
"(",
"options",
")",
"if",
"(",
"!",
"options",
".",
"net",
")",
"{",
"options",
"... | Tracks all incoming and outgoing network connections and logs a timeline of network traffic to a file.
@param options.net the `net` object to stub, default: nodejs net object
@param options.tickMs the number of milliseconds between ticks in the profile, default: 1000
@param options.tickWhenNoneActive should ticks be r... | [
"Tracks",
"all",
"incoming",
"and",
"outgoing",
"network",
"connections",
"and",
"logs",
"a",
"timeline",
"of",
"network",
"traffic",
"to",
"a",
"file",
"."
] | bf1a942944f0e99684ff7fe0e18314332e46f83e | https://github.com/cypress-io/cypress/blob/bf1a942944f0e99684ff7fe0e18314332e46f83e/packages/server/lib/util/net_profiler.js#L61-L79 | train | NetProfiler constructor. | [
30522,
3853,
5658,
21572,
8873,
3917,
1006,
7047,
1027,
1063,
1065,
1007,
1063,
2065,
1006,
999,
1006,
2023,
6013,
11253,
5658,
21572,
8873,
3917,
1007,
1007,
2709,
2047,
5658,
21572,
8873,
3917,
1006,
7047,
1007,
2065,
1006,
999,
7047,
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_PtgNameX | function parse_PtgNameX(blob, length, opts) {
if(opts.biff == 5) return parse_PtgNameX_BIFF5(blob, length, opts);
var type = (blob.read_shift(1) >>> 5) & 0x03;
var ixti = blob.read_shift(2); // XtiIndex
var nameindex = blob.read_shift(4);
return [type, ixti, nameindex];
} | javascript | function parse_PtgNameX(blob, length, opts) {
if(opts.biff == 5) return parse_PtgNameX_BIFF5(blob, length, opts);
var type = (blob.read_shift(1) >>> 5) & 0x03;
var ixti = blob.read_shift(2); // XtiIndex
var nameindex = blob.read_shift(4);
return [type, ixti, nameindex];
} | [
"function",
"parse_PtgNameX",
"(",
"blob",
",",
"length",
",",
"opts",
")",
"{",
"if",
"(",
"opts",
".",
"biff",
"==",
"5",
")",
"return",
"parse_PtgNameX_BIFF5",
"(",
"blob",
",",
"length",
",",
"opts",
")",
";",
"var",
"type",
"=",
"(",
"blob",
"."... | /* [MS-XLS] 2.5.198.77 ; [MS-XLSB] 2.5.97.61 | [
"/",
"*",
"[",
"MS",
"-",
"XLS",
"]",
"2",
".",
"5",
".",
"198",
".",
"77",
";",
"[",
"MS",
"-",
"XLSB",
"]",
"2",
".",
"5",
".",
"97",
".",
"61"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L10565-L10571 | train | Parse a PTG name | [
30522,
3853,
11968,
3366,
1035,
13866,
16989,
4168,
2595,
1006,
1038,
4135,
2497,
1010,
3091,
1010,
23569,
2015,
1007,
1063,
2065,
1006,
23569,
2015,
1012,
12170,
4246,
1027,
1027,
1019,
1007,
2709,
11968,
3366,
1035,
13866,
16989,
4168,
25... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dequelabs/axe-core | lib/core/base/rule.js | findAfterChecks | function findAfterChecks(rule) {
'use strict';
return axe.utils
.getAllChecks(rule)
.map(function(c) {
var check = rule._audit.checks[c.id || c];
return check && typeof check.after === 'function' ? check : null;
})
.filter(Boolean);
} | javascript | function findAfterChecks(rule) {
'use strict';
return axe.utils
.getAllChecks(rule)
.map(function(c) {
var check = rule._audit.checks[c.id || c];
return check && typeof check.after === 'function' ? check : null;
})
.filter(Boolean);
} | [
"function",
"findAfterChecks",
"(",
"rule",
")",
"{",
"'use strict'",
";",
"return",
"axe",
".",
"utils",
".",
"getAllChecks",
"(",
"rule",
")",
".",
"map",
"(",
"function",
"(",
"c",
")",
"{",
"var",
"check",
"=",
"rule",
".",
"_audit",
".",
"checks",... | Iterates the rule's Checks looking for ones that have an after function
@private
@param {Rule} rule The rule to check for after checks
@return {Array} Checks that have an after function | [
"Iterates",
"the",
"rule",
"s",
"Checks",
"looking",
"for",
"ones",
"that",
"have",
"an",
"after",
"function"
] | 727323c07980e2291575f545444d389fb942906f | https://github.com/dequelabs/axe-core/blob/727323c07980e2291575f545444d389fb942906f/lib/core/base/rule.js#L297-L307 | train | Find all checks after a rule | [
30522,
3853,
2424,
10354,
3334,
5403,
10603,
1006,
3627,
1007,
1063,
1005,
2224,
9384,
1005,
1025,
2709,
12946,
1012,
21183,
12146,
1012,
2131,
8095,
5403,
10603,
1006,
3627,
1007,
1012,
4949,
1006,
3853,
1006,
1039,
1007,
1063,
13075,
4638... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/AppCacheBuster.js | function(descriptor) {
var newDescriptor = {
get: descriptor.get,
set: function(val) {
if (fnIsACBUrl(val)) {
val = fnConvertUrl(val);
}
descriptor.set.call(this, val);
},
enumerable: descriptor.enumerable,
configurable: descriptor.configurable
};
... | javascript | function(descriptor) {
var newDescriptor = {
get: descriptor.get,
set: function(val) {
if (fnIsACBUrl(val)) {
val = fnConvertUrl(val);
}
descriptor.set.call(this, val);
},
enumerable: descriptor.enumerable,
configurable: descriptor.configurable
};
... | [
"function",
"(",
"descriptor",
")",
"{",
"var",
"newDescriptor",
"=",
"{",
"get",
":",
"descriptor",
".",
"get",
",",
"set",
":",
"function",
"(",
"val",
")",
"{",
"if",
"(",
"fnIsACBUrl",
"(",
"val",
")",
")",
"{",
"val",
"=",
"fnConvertUrl",
"(",
... | create an interceptor description which validates the value of the setter whether to rewrite the URL or not | [
"create",
"an",
"interceptor",
"description",
"which",
"validates",
"the",
"value",
"of",
"the",
"setter",
"whether",
"to",
"rewrite",
"the",
"URL",
"or",
"not"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/AppCacheBuster.js#L389-L403 | train | Returns a new descriptor that can be used to set a value in the configuration | [
30522,
3853,
1006,
4078,
23235,
2953,
1007,
1063,
13075,
2047,
6155,
23235,
2953,
1027,
1063,
2131,
1024,
4078,
23235,
2953,
1012,
2131,
1010,
2275,
1024,
3853,
1006,
11748,
1007,
1063,
2065,
1006,
1042,
8977,
6305,
8569,
12190,
1006,
11748... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
MithrilJS/mithril.js | render/render.js | createNodes | function createNodes(parent, vnodes, start, end, hooks, nextSibling, ns) {
for (var i = start; i < end; i++) {
var vnode = vnodes[i]
if (vnode != null) {
createNode(parent, vnode, hooks, ns, nextSibling)
}
}
} | javascript | function createNodes(parent, vnodes, start, end, hooks, nextSibling, ns) {
for (var i = start; i < end; i++) {
var vnode = vnodes[i]
if (vnode != null) {
createNode(parent, vnode, hooks, ns, nextSibling)
}
}
} | [
"function",
"createNodes",
"(",
"parent",
",",
"vnodes",
",",
"start",
",",
"end",
",",
"hooks",
",",
"nextSibling",
",",
"ns",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"start",
";",
"i",
"<",
"end",
";",
"i",
"++",
")",
"{",
"var",
"vnode",
"=",
... | create | [
"create"
] | 6d36fe09d129928c6b460720e08d9ed321fcd62b | https://github.com/MithrilJS/mithril.js/blob/6d36fe09d129928c6b460720e08d9ed321fcd62b/render/render.js#L48-L55 | train | Creates nodes from a list of vnodes | [
30522,
3853,
3443,
3630,
6155,
1006,
6687,
1010,
1058,
3630,
6155,
1010,
2707,
1010,
2203,
1010,
18008,
1010,
2279,
5332,
9709,
1010,
24978,
1007,
1063,
2005,
1006,
13075,
1045,
1027,
2707,
1025,
1045,
1026,
2203,
1025,
1045,
1009,
1009,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.rta/src/sap/ui/rta/appVariant/Feature.js | function(bAsKeyUser) {
var oDescriptor = fnGetDescriptor();
return new Promise(function(resolve) {
var fnCancel = function() {
AppVariantUtils.closeOverviewDialog();
};
sap.ui.require(["sap/ui/rta/appVariant/AppVariantOverviewDialog"], function(AppVariantOverviewDialog) {
if (!oAppVariantOv... | javascript | function(bAsKeyUser) {
var oDescriptor = fnGetDescriptor();
return new Promise(function(resolve) {
var fnCancel = function() {
AppVariantUtils.closeOverviewDialog();
};
sap.ui.require(["sap/ui/rta/appVariant/AppVariantOverviewDialog"], function(AppVariantOverviewDialog) {
if (!oAppVariantOv... | [
"function",
"(",
"bAsKeyUser",
")",
"{",
"var",
"oDescriptor",
"=",
"fnGetDescriptor",
"(",
")",
";",
"return",
"new",
"Promise",
"(",
"function",
"(",
"resolve",
")",
"{",
"var",
"fnCancel",
"=",
"function",
"(",
")",
"{",
"AppVariantUtils",
".",
"closeOv... | To see the overview of app variants, a key user has created from an app | [
"To",
"see",
"the",
"overview",
"of",
"app",
"variants",
"a",
"key",
"user",
"has",
"created",
"from",
"an",
"app"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.rta/src/sap/ui/rta/appVariant/Feature.js#L98-L122 | train | Opens the App Variant overview dialog | [
30522,
3853,
1006,
19021,
14839,
20330,
1007,
1063,
13075,
24040,
22483,
2953,
1027,
1042,
15465,
2102,
6155,
23235,
2953,
1006,
1007,
1025,
2709,
2047,
4872,
1006,
3853,
1006,
10663,
1007,
1063,
13075,
1042,
20909,
5897,
2140,
1027,
3853,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
adobe/brackets | src/language/JSUtils.js | findMatchingFunctions | function findMatchingFunctions(functionName, fileInfos, keepAllFiles) {
var result = new $.Deferred(),
jsFiles = [];
if (!keepAllFiles) {
// Filter fileInfos for .js files
jsFiles = fileInfos.filter(function (fileInfo) {
return FileUtils.getFileExten... | javascript | function findMatchingFunctions(functionName, fileInfos, keepAllFiles) {
var result = new $.Deferred(),
jsFiles = [];
if (!keepAllFiles) {
// Filter fileInfos for .js files
jsFiles = fileInfos.filter(function (fileInfo) {
return FileUtils.getFileExten... | [
"function",
"findMatchingFunctions",
"(",
"functionName",
",",
"fileInfos",
",",
"keepAllFiles",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"jsFiles",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"keepAllFiles",
")",
"{",
"// Filt... | Return all functions that have the specified name, searching across all the given files.
@param {!String} functionName The name to match.
@param {!Array.<File>} fileInfos The array of files to search.
@param {boolean=} keepAllFiles If true, don't ignore non-javascript files.
@return {$.Promise} that will be resolved w... | [
"Return",
"all",
"functions",
"that",
"have",
"the",
"specified",
"name",
"searching",
"across",
"all",
"the",
"given",
"files",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/JSUtils.js#L455-L477 | train | Find all matching functions in the project | [
30522,
3853,
2424,
18900,
8450,
11263,
27989,
2015,
1006,
3853,
18442,
1010,
5371,
2378,
14876,
2015,
1010,
2562,
8095,
8873,
4244,
1007,
1063,
13075,
2765,
1027,
2047,
1002,
1012,
13366,
28849,
2094,
1006,
1007,
1010,
1046,
22747,
9463,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SAP/openui5 | src/sap.ui.core/src/sap/ui/events/F6Navigation.js | findTabbables | function findTabbables(oRef, aScopes, bNext) {
var $Ref = jQuery(oRef),
$All, $Tabbables;
if (bNext) {
$All = jQuery.merge($Ref.find("*"), jQuery.merge($Ref.nextAll(), $Ref.parents().nextAll()));
$Tabbables = $All.find(':sapTabbable').addBack(':sapTabbable');
} else {
$All = jQuery.merge($Ref.... | javascript | function findTabbables(oRef, aScopes, bNext) {
var $Ref = jQuery(oRef),
$All, $Tabbables;
if (bNext) {
$All = jQuery.merge($Ref.find("*"), jQuery.merge($Ref.nextAll(), $Ref.parents().nextAll()));
$Tabbables = $All.find(':sapTabbable').addBack(':sapTabbable');
} else {
$All = jQuery.merge($Ref.... | [
"function",
"findTabbables",
"(",
"oRef",
",",
"aScopes",
",",
"bNext",
")",
"{",
"var",
"$Ref",
"=",
"jQuery",
"(",
"oRef",
")",
",",
"$All",
",",
"$Tabbables",
";",
"if",
"(",
"bNext",
")",
"{",
"$All",
"=",
"jQuery",
".",
"merge",
"(",
"$Ref",
"... | Returns a jQuery object which contains all next/previous (bNext) tabbable DOM elements of the given starting point (oRef) within the given scopes (DOMRefs) | [
"Returns",
"a",
"jQuery",
"object",
"which",
"contains",
"all",
"next",
"/",
"previous",
"(",
"bNext",
")",
"tabbable",
"DOM",
"elements",
"of",
"the",
"given",
"starting",
"point",
"(",
"oRef",
")",
"within",
"the",
"given",
"scopes",
"(",
"DOMRefs",
")"
... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/events/F6Navigation.js#L73-L89 | train | Find all tabbables in aScopes | [
30522,
3853,
2424,
2696,
22414,
13510,
1006,
10848,
2546,
1010,
2004,
16186,
2015,
1010,
24869,
10288,
2102,
1007,
1063,
13075,
1002,
25416,
1027,
1046,
4226,
2854,
1006,
10848,
2546,
1007,
1010,
1002,
2035,
1010,
1002,
21628,
3676,
13510,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Tonejs/Tone.js | scripts/collect_deps.js | collectDependencies | function collectDependencies(){
const files = glob.sync(posix.resolve(__dirname, "../Tone/!(shim)/!(Tone).js"));
const modules = files.map(f => f.slice(0, -3));
let reqString = modules.map(r => {
const relativePath = posix.relative(posix.resolve(__dirname, "../Tone"), r);
// const exportName = r.split("/")[r.spl... | javascript | function collectDependencies(){
const files = glob.sync(posix.resolve(__dirname, "../Tone/!(shim)/!(Tone).js"));
const modules = files.map(f => f.slice(0, -3));
let reqString = modules.map(r => {
const relativePath = posix.relative(posix.resolve(__dirname, "../Tone"), r);
// const exportName = r.split("/")[r.spl... | [
"function",
"collectDependencies",
"(",
")",
"{",
"const",
"files",
"=",
"glob",
".",
"sync",
"(",
"posix",
".",
"resolve",
"(",
"__dirname",
",",
"\"../Tone/!(shim)/!(Tone).js\"",
")",
")",
";",
"const",
"modules",
"=",
"files",
".",
"map",
"(",
"f",
"=>"... | COLLECT DEPENDENCIES | [
"COLLECT",
"DEPENDENCIES"
] | bb67e9c83d5553dfaa3c10babc147600aa14c147 | https://github.com/Tonejs/Tone.js/blob/bb67e9c83d5553dfaa3c10babc147600aa14c147/scripts/collect_deps.js#L8-L21 | train | collect dependencies from the core | [
30522,
3853,
8145,
3207,
11837,
4181,
9243,
1006,
1007,
1063,
9530,
3367,
6764,
1027,
1043,
4135,
2497,
1012,
26351,
1006,
13433,
5332,
2595,
1012,
10663,
1006,
1035,
1035,
16101,
18442,
1010,
1000,
1012,
1012,
1013,
4309,
1013,
999,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GitbookIO/gitbook | lib/utils/reducedObject.js | reducedObject | function reducedObject(defaultVersion, currentVersion) {
if(defaultVersion === undefined) {
return currentVersion;
}
return currentVersion.reduce(function(result, value, key) {
var defaultValue = defaultVersion.get(key);
if (Immutable.Map.isMap(value)) {
var diffs = red... | javascript | function reducedObject(defaultVersion, currentVersion) {
if(defaultVersion === undefined) {
return currentVersion;
}
return currentVersion.reduce(function(result, value, key) {
var defaultValue = defaultVersion.get(key);
if (Immutable.Map.isMap(value)) {
var diffs = red... | [
"function",
"reducedObject",
"(",
"defaultVersion",
",",
"currentVersion",
")",
"{",
"if",
"(",
"defaultVersion",
"===",
"undefined",
")",
"{",
"return",
"currentVersion",
";",
"}",
"return",
"currentVersion",
".",
"reduce",
"(",
"function",
"(",
"result",
",",
... | Reduce the difference between a map and its default version
@param {Map} defaultVersion
@param {Map} currentVersion
@return {Map} The properties of currentVersion that differs from defaultVersion | [
"Reduce",
"the",
"difference",
"between",
"a",
"map",
"and",
"its",
"default",
"version"
] | 6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4 | https://github.com/GitbookIO/gitbook/blob/6c6ef7f4af32a2977e44dd23d3feb6ebf28970f4/lib/utils/reducedObject.js#L9-L31 | train | reducedObject - reduce the current object to the new object | [
30522,
3853,
4359,
16429,
20614,
1006,
12398,
27774,
1010,
2783,
27774,
1007,
1063,
2065,
1006,
12398,
27774,
1027,
1027,
1027,
6151,
28344,
1007,
1063,
2709,
2783,
27774,
1025,
1065,
2709,
2783,
27774,
1012,
5547,
1006,
3853,
1006,
2765,
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... |
feathericons/feather | src/replace.js | getAttrs | function getAttrs(element) {
return Array.from(element.attributes).reduce((attrs, attr) => {
attrs[attr.name] = attr.value;
return attrs;
}, {});
} | javascript | function getAttrs(element) {
return Array.from(element.attributes).reduce((attrs, attr) => {
attrs[attr.name] = attr.value;
return attrs;
}, {});
} | [
"function",
"getAttrs",
"(",
"element",
")",
"{",
"return",
"Array",
".",
"from",
"(",
"element",
".",
"attributes",
")",
".",
"reduce",
"(",
"(",
"attrs",
",",
"attr",
")",
"=>",
"{",
"attrs",
"[",
"attr",
".",
"name",
"]",
"=",
"attr",
".",
"valu... | Get the attributes of an HTML element.
@param {HTMLElement} element
@returns {Object} | [
"Get",
"the",
"attributes",
"of",
"an",
"HTML",
"element",
"."
] | 8f658193d25e943b196a2367319b5d9e85ee9f9f | https://github.com/feathericons/feather/blob/8f658193d25e943b196a2367319b5d9e85ee9f9f/src/replace.js#L53-L58 | train | Get the attributes of an element | [
30522,
3853,
2131,
19321,
2869,
1006,
5783,
1007,
1063,
2709,
9140,
1012,
2013,
1006,
5783,
1012,
12332,
1007,
1012,
5547,
1006,
1006,
2012,
16344,
2015,
1010,
2012,
16344,
1007,
1027,
1028,
1063,
2012,
16344,
2015,
1031,
2012,
16344,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-echarts | src/model/Series.js | function (option, ecModel) {
var layoutMode = this.layoutMode;
var inputPositionParams = layoutMode
? getLayoutParams(option) : {};
// Backward compat: using subType on theme.
// But if name duplicate between series subType
// (for example: parallel) add component ma... | javascript | function (option, ecModel) {
var layoutMode = this.layoutMode;
var inputPositionParams = layoutMode
? getLayoutParams(option) : {};
// Backward compat: using subType on theme.
// But if name duplicate between series subType
// (for example: parallel) add component ma... | [
"function",
"(",
"option",
",",
"ecModel",
")",
"{",
"var",
"layoutMode",
"=",
"this",
".",
"layoutMode",
";",
"var",
"inputPositionParams",
"=",
"layoutMode",
"?",
"getLayoutParams",
"(",
"option",
")",
":",
"{",
"}",
";",
"// Backward compat: using subType on ... | Util for merge default and theme to option
@param {Object} option
@param {module:echarts/model/Global} ecModel | [
"Util",
"for",
"merge",
"default",
"and",
"theme",
"to",
"option"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/model/Series.js#L137-L164 | train | Merge the options with the current options | [
30522,
3853,
1006,
5724,
1010,
14925,
5302,
9247,
1007,
1063,
13075,
9621,
5302,
3207,
1027,
2023,
1012,
9621,
5302,
3207,
1025,
13075,
7953,
26994,
28689,
5244,
1027,
9621,
5302,
3207,
1029,
2131,
8485,
5833,
28689,
5244,
1006,
5724,
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... | |
GeekyAnts/vue-native-core | packages/vue-native-core/build.js | initEvents | function initEvents (vm) {
vm._events = Object.create(null);
/**
* react-vue change
*/
if (Array.isArray(vm.$options.reactVueCustomEvent)) {
vm.$options.reactVueCustomEvent.forEach(function (v) {
vm.$on(v.name, v.handle);
});
}
// vm._hasHookEvent = false
// // init parent attached even... | javascript | function initEvents (vm) {
vm._events = Object.create(null);
/**
* react-vue change
*/
if (Array.isArray(vm.$options.reactVueCustomEvent)) {
vm.$options.reactVueCustomEvent.forEach(function (v) {
vm.$on(v.name, v.handle);
});
}
// vm._hasHookEvent = false
// // init parent attached even... | [
"function",
"initEvents",
"(",
"vm",
")",
"{",
"vm",
".",
"_events",
"=",
"Object",
".",
"create",
"(",
"null",
")",
";",
"/**\n * react-vue change\n */",
"if",
"(",
"Array",
".",
"isArray",
"(",
"vm",
".",
"$options",
".",
"reactVueCustomEvent",
")",
... | /* /* | [
"/",
"*",
"/",
"*"
] | a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e | https://github.com/GeekyAnts/vue-native-core/blob/a7b4c9e35fe3f01d7576086f41e5e9ec6975b72e/packages/vue-native-core/build.js#L1968-L1985 | train | init events | [
30522,
3853,
1999,
4221,
15338,
2015,
1006,
1058,
2213,
1007,
1063,
1058,
2213,
1012,
1035,
2824,
1027,
4874,
1012,
3443,
1006,
19701,
1007,
1025,
1013,
1008,
1008,
1008,
10509,
1011,
24728,
2063,
2689,
1008,
1013,
2065,
1006,
9140,
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... |
lovell/sharp | lib/input.js | _flattenBufferIn | function _flattenBufferIn () {
if (this._isStreamInput()) {
this.options.input.buffer = Buffer.concat(this.options.input.buffer);
}
} | javascript | function _flattenBufferIn () {
if (this._isStreamInput()) {
this.options.input.buffer = Buffer.concat(this.options.input.buffer);
}
} | [
"function",
"_flattenBufferIn",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_isStreamInput",
"(",
")",
")",
"{",
"this",
".",
"options",
".",
"input",
".",
"buffer",
"=",
"Buffer",
".",
"concat",
"(",
"this",
".",
"options",
".",
"input",
".",
"buffer",
... | Flattens the array of chunks accumulated in input.buffer.
@private | [
"Flattens",
"the",
"array",
"of",
"chunks",
"accumulated",
"in",
"input",
".",
"buffer",
"."
] | 05d76eeadfe54713606a615185b2da047923406b | https://github.com/lovell/sharp/blob/05d76eeadfe54713606a615185b2da047923406b/lib/input.js#L137-L141 | train | Flatten buffer in input | [
30522,
3853,
1035,
4257,
6528,
8569,
12494,
2378,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
1035,
26354,
25379,
2378,
18780,
1006,
1007,
1007,
1063,
2023,
1012,
7047,
1012,
7953,
1012,
17698,
1027,
17698,
1012,
9530,
11266,
1006,
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.table/src/sap/ui/table/TableAccExtension.js | function(oExtension) {
var oTable = oExtension.getTable(),
oIN = oTable._getItemNavigation(),
bIsRowChanged = false,
bIsColChanged = false,
bIsInitial = false;
if (oIN) {
var iColumnNumber = ExtensionHelper.getColumnIndexOfFocusedCell(oExtension) + 1; // +1 -> we want to announce a count and ... | javascript | function(oExtension) {
var oTable = oExtension.getTable(),
oIN = oTable._getItemNavigation(),
bIsRowChanged = false,
bIsColChanged = false,
bIsInitial = false;
if (oIN) {
var iColumnNumber = ExtensionHelper.getColumnIndexOfFocusedCell(oExtension) + 1; // +1 -> we want to announce a count and ... | [
"function",
"(",
"oExtension",
")",
"{",
"var",
"oTable",
"=",
"oExtension",
".",
"getTable",
"(",
")",
",",
"oIN",
"=",
"oTable",
".",
"_getItemNavigation",
"(",
")",
",",
"bIsRowChanged",
"=",
"false",
",",
"bIsColChanged",
"=",
"false",
",",
"bIsInitial... | /*
Determines the current row and column and updates the hidden description texts of the table accordingly. | [
"/",
"*",
"Determines",
"the",
"current",
"row",
"and",
"column",
"and",
"updates",
"the",
"hidden",
"description",
"texts",
"of",
"the",
"table",
"accordingly",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.table/src/sap/ui/table/TableAccExtension.js#L240-L275 | train | Updates the pager pager | [
30522,
3853,
1006,
1051,
10288,
29048,
1007,
1063,
13075,
27178,
3085,
1027,
1051,
10288,
29048,
1012,
2131,
10880,
1006,
1007,
1010,
1051,
2378,
1027,
27178,
3085,
1012,
1035,
2131,
4221,
2213,
2532,
5737,
12540,
1006,
1007,
1010,
20377,
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/editor/EditorManager.js | _handleRemoveFromPaneView | function _handleRemoveFromPaneView(e, removedFiles) {
var handleFileRemoved = function (file) {
var doc = DocumentManager.getOpenDocumentForPath(file.fullPath);
if (doc) {
MainViewManager._destroyEditorIfNotNeeded(doc);
}
};
// when files are... | javascript | function _handleRemoveFromPaneView(e, removedFiles) {
var handleFileRemoved = function (file) {
var doc = DocumentManager.getOpenDocumentForPath(file.fullPath);
if (doc) {
MainViewManager._destroyEditorIfNotNeeded(doc);
}
};
// when files are... | [
"function",
"_handleRemoveFromPaneView",
"(",
"e",
",",
"removedFiles",
")",
"{",
"var",
"handleFileRemoved",
"=",
"function",
"(",
"file",
")",
"{",
"var",
"doc",
"=",
"DocumentManager",
".",
"getOpenDocumentForPath",
"(",
"file",
".",
"fullPath",
")",
";",
"... | file removed from pane handler.
@param {jQuery.Event} e
@param {File|Array.<File>} removedFiles - file, path or array of files or paths that are being removed | [
"file",
"removed",
"from",
"pane",
"handler",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/EditorManager.js#L691-L709 | train | handleRemoveFromPaneView - handles file removed from pane | [
30522,
3853,
1035,
28213,
6633,
21818,
19699,
25377,
7231,
8584,
1006,
1041,
1010,
3718,
8873,
4244,
1007,
1063,
13075,
5047,
8873,
3917,
6633,
21818,
2094,
1027,
3853,
1006,
5371,
1007,
1063,
13075,
9986,
1027,
6254,
24805,
4590,
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... |
aws/aws-sdk-js | lib/event-stream/int64.js | Int64 | function Int64(bytes) {
if (bytes.length !== 8) {
throw new Error('Int64 buffers must be exactly 8 bytes');
}
if (!util.Buffer.isBuffer(bytes)) bytes = toBuffer(bytes);
this.bytes = bytes;
} | javascript | function Int64(bytes) {
if (bytes.length !== 8) {
throw new Error('Int64 buffers must be exactly 8 bytes');
}
if (!util.Buffer.isBuffer(bytes)) bytes = toBuffer(bytes);
this.bytes = bytes;
} | [
"function",
"Int64",
"(",
"bytes",
")",
"{",
"if",
"(",
"bytes",
".",
"length",
"!==",
"8",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Int64 buffers must be exactly 8 bytes'",
")",
";",
"}",
"if",
"(",
"!",
"util",
".",
"Buffer",
".",
"isBuffer",
"(",
"... | A lossless representation of a signed, 64-bit integer. Instances of this
class may be used in arithmetic expressions as if they were numeric
primitives, but the binary representation will be preserved unchanged as the
`bytes` property of the object. The bytes should be encoded as big-endian,
two's complement integers.
... | [
"A",
"lossless",
"representation",
"of",
"a",
"signed",
"64",
"-",
"bit",
"integer",
".",
"Instances",
"of",
"this",
"class",
"may",
"be",
"used",
"in",
"arithmetic",
"expressions",
"as",
"if",
"they",
"were",
"numeric",
"primitives",
"but",
"the",
"binary",... | c23e5f0edd150f8885267e5f7c8a564f8e6e8562 | https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/event-stream/int64.js#L14-L21 | train | Int64 constructor. | [
30522,
3853,
20014,
21084,
1006,
27507,
1007,
1063,
2065,
1006,
27507,
1012,
3091,
999,
1027,
1027,
1022,
1007,
1063,
5466,
2047,
7561,
1006,
1005,
20014,
21084,
17698,
2015,
2442,
2022,
3599,
1022,
27507,
1005,
1007,
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... |
SAP/openui5 | src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js | function(oStep){
var sTooltip = oStep.getTooltip_AsString();
if (!sTooltip && !oStep.getTooltip() && sap.ui.getCore().getConfiguration().getAccessibility()) {
sTooltip = getText("RDMP_DEFAULT_STEP_TOOLTIP", [oStep.__stepName]);
}
return sTooltip || "";
} | javascript | function(oStep){
var sTooltip = oStep.getTooltip_AsString();
if (!sTooltip && !oStep.getTooltip() && sap.ui.getCore().getConfiguration().getAccessibility()) {
sTooltip = getText("RDMP_DEFAULT_STEP_TOOLTIP", [oStep.__stepName]);
}
return sTooltip || "";
} | [
"function",
"(",
"oStep",
")",
"{",
"var",
"sTooltip",
"=",
"oStep",
".",
"getTooltip_AsString",
"(",
")",
";",
"if",
"(",
"!",
"sTooltip",
"&&",
"!",
"oStep",
".",
"getTooltip",
"(",
")",
"&&",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"get... | Returns the tooltip of the given step | [
"Returns",
"the",
"tooltip",
"of",
"the",
"given",
"step"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.commons/src/sap/ui/commons/RoadMapRenderer.js#L628-L634 | train | Returns the tooltip of the given step | [
30522,
3853,
1006,
9808,
2618,
2361,
1007,
1063,
13075,
14708,
25101,
30524,
11514,
1006,
1007,
1004,
1004,
20066,
1012,
21318,
1012,
2131,
17345,
1006,
1007,
1012,
2131,
8663,
8873,
27390,
3370,
1006,
1007,
1012,
2131,
6305,
9623,
28255,
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... | |
eslint/eslint | lib/code-path-analysis/code-path-analyzer.js | postprocess | function postprocess(analyzer, node) {
switch (node.type) {
case "Program":
case "FunctionDeclaration":
case "FunctionExpression":
case "ArrowFunctionExpression": {
let codePath = analyzer.codePath;
// Mark the current path as the final node.
Code... | javascript | function postprocess(analyzer, node) {
switch (node.type) {
case "Program":
case "FunctionDeclaration":
case "FunctionExpression":
case "ArrowFunctionExpression": {
let codePath = analyzer.codePath;
// Mark the current path as the final node.
Code... | [
"function",
"postprocess",
"(",
"analyzer",
",",
"node",
")",
"{",
"switch",
"(",
"node",
".",
"type",
")",
"{",
"case",
"\"Program\"",
":",
"case",
"\"FunctionDeclaration\"",
":",
"case",
"\"FunctionExpression\"",
":",
"case",
"\"ArrowFunctionExpression\"",
":",
... | Updates the code path to finalize the current code path.
@param {CodePathAnalyzer} analyzer - The instance.
@param {ASTNode} node - The current AST node.
@returns {void} | [
"Updates",
"the",
"code",
"path",
"to",
"finalize",
"the",
"current",
"code",
"path",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/code-path-analysis/code-path-analyzer.js#L557-L586 | train | Post - process the node. | [
30522,
3853,
2695,
21572,
9623,
2015,
1006,
17908,
2099,
1010,
13045,
1007,
1063,
6942,
1006,
13045,
1012,
2828,
1007,
1063,
2553,
1000,
2565,
1000,
1024,
2553,
1000,
3853,
3207,
20464,
25879,
3258,
1000,
1024,
2553,
1000,
3853,
10288,
2011... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | javascript/selenium-core/xpath/util.js | copyArray | function copyArray(dst, src) {
if (!src) return;
var dstLength = dst.length;
for (var i = src.length - 1; i >= 0; --i) {
dst[i+dstLength] = src[i];
}
} | javascript | function copyArray(dst, src) {
if (!src) return;
var dstLength = dst.length;
for (var i = src.length - 1; i >= 0; --i) {
dst[i+dstLength] = src[i];
}
} | [
"function",
"copyArray",
"(",
"dst",
",",
"src",
")",
"{",
"if",
"(",
"!",
"src",
")",
"return",
";",
"var",
"dstLength",
"=",
"dst",
".",
"length",
";",
"for",
"(",
"var",
"i",
"=",
"src",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"... | Shallow-copies an array to the end of another array Basically Array.concat, but works with other non-array collections | [
"Shallow",
"-",
"copies",
"an",
"array",
"to",
"the",
"end",
"of",
"another",
"array",
"Basically",
"Array",
".",
"concat",
"but",
"works",
"with",
"other",
"non",
"-",
"array",
"collections"
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/javascript/selenium-core/xpath/util.js#L221-L227 | train | Copy an array of words to a destination array | [
30522,
3853,
6100,
2906,
9447,
1006,
16233,
2102,
1010,
5034,
2278,
1007,
1063,
2065,
1006,
999,
5034,
2278,
1007,
2709,
1025,
13075,
16233,
9286,
3070,
2705,
1027,
16233,
2102,
1012,
3091,
1025,
2005,
1006,
13075,
1045,
1027,
5034,
2278,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
exceljs/exceljs | lib/utils/zip-stream.js | function(options) {
this.count = 0;
this.jsZip = new JSZip();
this.stream = new StreamBuf();
this.stream.on('finish', () => {
this._process();
});
this.getEntryType = options.getEntryType || (() => 'string');
} | javascript | function(options) {
this.count = 0;
this.jsZip = new JSZip();
this.stream = new StreamBuf();
this.stream.on('finish', () => {
this._process();
});
this.getEntryType = options.getEntryType || (() => 'string');
} | [
"function",
"(",
"options",
")",
"{",
"this",
".",
"count",
"=",
"0",
";",
"this",
".",
"jsZip",
"=",
"new",
"JSZip",
"(",
")",
";",
"this",
".",
"stream",
"=",
"new",
"StreamBuf",
"(",
")",
";",
"this",
".",
"stream",
".",
"on",
"(",
"'finish'",... | ============================================================================= The ZipReader class Unpacks an incoming zip stream | [
"=============================================================================",
"The",
"ZipReader",
"class",
"Unpacks",
"an",
"incoming",
"zip",
"stream"
] | c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2 | https://github.com/exceljs/exceljs/blob/c6ee7a14d5e0e5a07bf0e475aa4dd7b9a1e907f2/lib/utils/zip-stream.js#L19-L27 | train | A class that represents a single entry in the zip file. | [
30522,
3853,
1006,
7047,
1007,
1063,
2023,
1012,
4175,
1027,
1014,
1025,
2023,
1012,
1046,
17112,
11514,
1027,
2047,
1046,
17112,
11514,
1006,
1007,
1025,
2023,
1012,
5460,
1027,
2047,
5460,
8569,
2546,
1006,
1007,
1025,
2023,
1012,
5460,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/cache/CacheManager.js | function () {
var that = this;
return Promise.resolve().then(function () {
var oCfg = sap.ui.getCore().getConfiguration();
if (!oCfg.isUI5CacheOn()) {
safeClearInstance(that);
sap.ui.getCore().getConfiguration().setUI5CacheOn(true);
}
return Promise.resolve();
});
} | javascript | function () {
var that = this;
return Promise.resolve().then(function () {
var oCfg = sap.ui.getCore().getConfiguration();
if (!oCfg.isUI5CacheOn()) {
safeClearInstance(that);
sap.ui.getCore().getConfiguration().setUI5CacheOn(true);
}
return Promise.resolve();
});
} | [
"function",
"(",
")",
"{",
"var",
"that",
"=",
"this",
";",
"return",
"Promise",
".",
"resolve",
"(",
")",
".",
"then",
"(",
"function",
"(",
")",
"{",
"var",
"oCfg",
"=",
"sap",
".",
"ui",
".",
"getCore",
"(",
")",
".",
"getConfiguration",
"(",
... | Starts the Cache Manager (all next calls to it will work against real cache data)
Usages are meant for testing purposes. If its already on, nothing will happen
@returns {*}
@protected | [
"Starts",
"the",
"Cache",
"Manager",
"(",
"all",
"next",
"calls",
"to",
"it",
"will",
"work",
"against",
"real",
"cache",
"data",
")",
"Usages",
"are",
"meant",
"for",
"testing",
"purposes",
".",
"If",
"its",
"already",
"on",
"nothing",
"will",
"happen"
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/core/cache/CacheManager.js#L260-L270 | train | Clear all the cache instances | [
30522,
3853,
1006,
1007,
1063,
13075,
2008,
1027,
2023,
1025,
2709,
4872,
1012,
10663,
1006,
1007,
1012,
2059,
1006,
3853,
1006,
1007,
1063,
13075,
1051,
2278,
2546,
2290,
1027,
20066,
1012,
21318,
1012,
2131,
17345,
1006,
1007,
1012,
2131,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
SAP/openui5 | src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js | function (mChangeListeners, sPropertyPath, vValue) {
var aListeners = mChangeListeners[sPropertyPath],
i;
if (aListeners) {
for (i = 0; i < aListeners.length; i += 1) {
aListeners[i].onChange(vValue);
}
}
} | javascript | function (mChangeListeners, sPropertyPath, vValue) {
var aListeners = mChangeListeners[sPropertyPath],
i;
if (aListeners) {
for (i = 0; i < aListeners.length; i += 1) {
aListeners[i].onChange(vValue);
}
}
} | [
"function",
"(",
"mChangeListeners",
",",
"sPropertyPath",
",",
"vValue",
")",
"{",
"var",
"aListeners",
"=",
"mChangeListeners",
"[",
"sPropertyPath",
"]",
",",
"i",
";",
"if",
"(",
"aListeners",
")",
"{",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"aL... | Fires a change event to all listeners for the given path in mChangeListeners.
@param {object} mChangeListeners A map of change listeners by path
@param {string} sPropertyPath The path
@param {any} vValue The value to report to the listeners | [
"Fires",
"a",
"change",
"event",
"to",
"all",
"listeners",
"for",
"the",
"given",
"path",
"in",
"mChangeListeners",
"."
] | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Helper.js#L395-L404 | train | Call all listeners | [
30522,
3853,
1006,
11338,
18003,
29282,
6528,
2545,
1010,
11867,
18981,
15010,
15069,
1010,
1058,
10175,
5657,
1007,
1063,
13075,
4862,
16173,
2545,
1027,
11338,
18003,
29282,
6528,
2545,
1031,
11867,
18981,
15010,
15069,
1033,
1010,
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... | |
adobe/brackets | src/LiveDevelopment/Agents/DOMHelpers.js | _findTag | function _findTag(src, skip) {
var from, to, inc;
from = _find(src, [/<[a-z!\/]/i, 2], skip);
if (from < 0) {
return null;
}
if (src.substr(from, 4) === "<!--") {
// html comments
to = _find(src, "-->", from + 4);
inc = 3;
}... | javascript | function _findTag(src, skip) {
var from, to, inc;
from = _find(src, [/<[a-z!\/]/i, 2], skip);
if (from < 0) {
return null;
}
if (src.substr(from, 4) === "<!--") {
// html comments
to = _find(src, "-->", from + 4);
inc = 3;
}... | [
"function",
"_findTag",
"(",
"src",
",",
"skip",
")",
"{",
"var",
"from",
",",
"to",
",",
"inc",
";",
"from",
"=",
"_find",
"(",
"src",
",",
"[",
"/",
"<[a-z!\\/]",
"/",
"i",
",",
"2",
"]",
",",
"skip",
")",
";",
"if",
"(",
"from",
"<",
"0",
... | Find the next tag
@param {string} source string
@param {integer} ignore characters before this offset | [
"Find",
"the",
"next",
"tag"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/Agents/DOMHelpers.js#L116-L142 | train | find tag in src | [
30522,
3853,
1035,
2424,
15900,
1006,
5034,
2278,
1010,
13558,
1007,
1063,
13075,
2013,
1010,
2000,
1010,
4297,
1025,
2013,
1027,
1035,
2424,
1006,
5034,
2278,
1010,
1031,
1013,
1026,
1031,
1037,
1011,
1062,
999,
1032,
1013,
1033,
1013,
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... |
eslint/eslint | lib/rules/no-bitwise.js | report | function report(node) {
context.report({ node, messageId: "unexpected", data: { operator: node.operator } });
} | javascript | function report(node) {
context.report({ node, messageId: "unexpected", data: { operator: node.operator } });
} | [
"function",
"report",
"(",
"node",
")",
"{",
"context",
".",
"report",
"(",
"{",
"node",
",",
"messageId",
":",
"\"unexpected\"",
",",
"data",
":",
"{",
"operator",
":",
"node",
".",
"operator",
"}",
"}",
")",
";",
"}"
] | Reports an unexpected use of a bitwise operator.
@param {ASTNode} node Node which contains the bitwise operator.
@returns {void} | [
"Reports",
"an",
"unexpected",
"use",
"of",
"a",
"bitwise",
"operator",
"."
] | bc0819c94aad14f7fad3cbc2338ea15658b0f272 | https://github.com/eslint/eslint/blob/bc0819c94aad14f7fad3cbc2338ea15658b0f272/lib/rules/no-bitwise.js#L69-L71 | train | Reports an unexpected operator. | [
30522,
3853,
3189,
1006,
13045,
1007,
1063,
6123,
1012,
3189,
1006,
1063,
13045,
1010,
4471,
3593,
1024,
1000,
9223,
1000,
1010,
2951,
1024,
1063,
6872,
1024,
13045,
1012,
6872,
1065,
1065,
1007,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | third_party/js/mozmill/shared-modules/localization.js | checkDimensions | function checkDimensions(child) {
if (!child.boxObject)
return [];
var childBox = child.boxObject;
var parent = childBox.parentBox;
// toplevel element or hidden elements, like script tags
if (!parent || parent == child.element || !parent.boxObject) {
return [];
}
var parentBox = parent.boxObject... | javascript | function checkDimensions(child) {
if (!child.boxObject)
return [];
var childBox = child.boxObject;
var parent = childBox.parentBox;
// toplevel element or hidden elements, like script tags
if (!parent || parent == child.element || !parent.boxObject) {
return [];
}
var parentBox = parent.boxObject... | [
"function",
"checkDimensions",
"(",
"child",
")",
"{",
"if",
"(",
"!",
"child",
".",
"boxObject",
")",
"return",
"[",
"]",
";",
"var",
"childBox",
"=",
"child",
".",
"boxObject",
";",
"var",
"parent",
"=",
"childBox",
".",
"parentBox",
";",
"// toplevel ... | Callback function for testing for cropped elements.
Checks if the XUL boxObject has screen coordinates outside of
the screen coordinates of its parent. If there's no parent, return.
@param {node} child
@returns List of boxes that can be highlighted on a screenshot
@type {array of array of int} | [
"Callback",
"function",
"for",
"testing",
"for",
"cropped",
"elements",
"."
] | 38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd | https://github.com/SeleniumHQ/selenium/blob/38d5e4440b2c866a78a1ccb2a18d9795a1bdeafd/third_party/js/mozmill/shared-modules/localization.js#L130-L181 | train | Check dimensions of a node | [
30522,
3853,
4638,
22172,
6132,
8496,
1006,
2775,
1007,
1063,
2065,
1006,
999,
2775,
1012,
3482,
16429,
20614,
1007,
2709,
1031,
1033,
1025,
13075,
2775,
8758,
1027,
2775,
1012,
3482,
16429,
20614,
1025,
13075,
6687,
1027,
2775,
8758,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-echarts | src/scale/Time.js | function (a, x, lo, hi) {
while (lo < hi) {
var mid = lo + hi >>> 1;
if (a[mid][1] < x) {
lo = mid + 1;
}
else {
hi = mid;
}
}
return lo;
} | javascript | function (a, x, lo, hi) {
while (lo < hi) {
var mid = lo + hi >>> 1;
if (a[mid][1] < x) {
lo = mid + 1;
}
else {
hi = mid;
}
}
return lo;
} | [
"function",
"(",
"a",
",",
"x",
",",
"lo",
",",
"hi",
")",
"{",
"while",
"(",
"lo",
"<",
"hi",
")",
"{",
"var",
"mid",
"=",
"lo",
"+",
"hi",
">>>",
"1",
";",
"if",
"(",
"a",
"[",
"mid",
"]",
"[",
"1",
"]",
"<",
"x",
")",
"{",
"lo",
"=... | FIXME 公用? | [
"FIXME",
"公用?"
] | 4d0ea095dc3929cb6de40c45748826e7999c7aa8 | https://github.com/apache/incubator-echarts/blob/4d0ea095dc3929cb6de40c45748826e7999c7aa8/src/scale/Time.js#L57-L68 | train | returns the index of the first element of a array that is less than x | [
30522,
3853,
1006,
1037,
1010,
1060,
1010,
8840,
1010,
7632,
1007,
1063,
2096,
1006,
8840,
1026,
7632,
1007,
1063,
13075,
3054,
1027,
8840,
1009,
7632,
1028,
1028,
1028,
1015,
1025,
2065,
1006,
1037,
1031,
3054,
1033,
1031,
1015,
1033,
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... | |
SheetJS/js-xlsx | xlsx.js | parse_TransformInfoHeader | function parse_TransformInfoHeader(blob) {
var o = {};
/*var len = */blob.read_shift(4);
blob.l += 4; // must be 0x1
o.id = blob.read_shift(0, 'lpp4');
o.name = blob.read_shift(0, 'lpp4');
o.R = parse_CRYPTOVersion(blob, 4);
o.U = parse_CRYPTOVersion(blob, 4);
o.W = parse_CRYPTOVersion(blob, 4);
return o;
} | javascript | function parse_TransformInfoHeader(blob) {
var o = {};
/*var len = */blob.read_shift(4);
blob.l += 4; // must be 0x1
o.id = blob.read_shift(0, 'lpp4');
o.name = blob.read_shift(0, 'lpp4');
o.R = parse_CRYPTOVersion(blob, 4);
o.U = parse_CRYPTOVersion(blob, 4);
o.W = parse_CRYPTOVersion(blob, 4);
return o;
} | [
"function",
"parse_TransformInfoHeader",
"(",
"blob",
")",
"{",
"var",
"o",
"=",
"{",
"}",
";",
"/*var len = */",
"blob",
".",
"read_shift",
"(",
"4",
")",
";",
"blob",
".",
"l",
"+=",
"4",
";",
"// must be 0x1",
"o",
".",
"id",
"=",
"blob",
".",
"re... | /* [MS-OFFCRYPTO] 2.1.8 DataSpaceDefinition | [
"/",
"*",
"[",
"MS",
"-",
"OFFCRYPTO",
"]",
"2",
".",
"1",
".",
"8",
"DataSpaceDefinition"
] | 9a6d8a1d3d80c78dad5201fb389316f935279cdc | https://github.com/SheetJS/js-xlsx/blob/9a6d8a1d3d80c78dad5201fb389316f935279cdc/xlsx.js#L8174-L8184 | train | Parse a transform info header | [
30522,
3853,
11968,
3366,
1035,
10938,
2378,
14876,
4974,
2121,
1006,
1038,
4135,
2497,
1007,
1063,
13075,
1051,
1027,
1063,
1065,
1025,
1013,
1008,
13075,
18798,
1027,
1008,
1013,
1038,
4135,
2497,
1012,
3191,
1035,
5670,
1006,
1018,
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.core/src/sap/ui/model/odata/_ODataMetaModelUtils.js | function (sSemantics, sTypesList, oProperty, oType) {
var aResult = [],
oV4TypeInfo = mV2SemanticsToV4TypeInfo[sSemantics];
if (oV4TypeInfo) {
sTypesList.split(",").forEach(function (sType) {
var sTargetType = oV4TypeInfo.typeMapping[sType];
if (sTargetType) {
aResult.push(oV4TypeInfo.v4E... | javascript | function (sSemantics, sTypesList, oProperty, oType) {
var aResult = [],
oV4TypeInfo = mV2SemanticsToV4TypeInfo[sSemantics];
if (oV4TypeInfo) {
sTypesList.split(",").forEach(function (sType) {
var sTargetType = oV4TypeInfo.typeMapping[sType];
if (sTargetType) {
aResult.push(oV4TypeInfo.v4E... | [
"function",
"(",
"sSemantics",
",",
"sTypesList",
",",
"oProperty",
",",
"oType",
")",
"{",
"var",
"aResult",
"=",
"[",
"]",
",",
"oV4TypeInfo",
"=",
"mV2SemanticsToV4TypeInfo",
"[",
"sSemantics",
"]",
";",
"if",
"(",
"oV4TypeInfo",
")",
"{",
"sTypesList",
... | Compute a space-separated list of V4 annotation enumeration values for the given
sap:semantics "tel" and "email".
E.g. for <code>sap:semantics="tel;type=fax"</code> this function returns
"com.sap.vocabularies.Communication.v1.PhoneType/fax".
@param {string} sSemantics
the sap:semantics value ("tel" or "email")
@param ... | [
"Compute",
"a",
"space",
"-",
"separated",
"list",
"of",
"V4",
"annotation",
"enumeration",
"values",
"for",
"the",
"given",
"sap",
":",
"semantics",
"tel",
"and",
"email",
".",
"E",
".",
"g",
".",
"for",
"<code",
">",
"sap",
":",
"semantics",
"=",
"te... | 8a832fca01cb1cdf8df589788e0c5723e2a33c70 | https://github.com/SAP/openui5/blob/8a832fca01cb1cdf8df589788e0c5723e2a33c70/src/sap.ui.core/src/sap/ui/model/odata/_ODataMetaModelUtils.js#L761-L777 | train | Returns the type of the target type for the given semantic and property. | [
30522,
3853,
1006,
7020,
16704,
14606,
1010,
2358,
18863,
14540,
2923,
1010,
6728,
18981,
15010,
1010,
27178,
18863,
1007,
1063,
13075,
23631,
11314,
1027,
1031,
1033,
1010,
1051,
2615,
2549,
13874,
2378,
14876,
1027,
19842,
2475,
3366,
2386,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.