_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 27 233k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q33300 | init | train | function init() { // {{{2
/**
* Class constructor
*
* @method constructor
*/
O.inherited(this)();
this.setMaxListeners(Consts.coreListeners);
this.subjectState = this.SUBJECT_STATE.INIT;
this.homeTimeOffset = 0;
this.lastTid = 0; // {{{3
/**
* Autoincemental part of last transaction id created... | javascript | {
"resource": ""
} |
q33301 | arrayIncludesWith | train | function arrayIncludesWith(array, value, comparator) {
var index = -1, length = array.length;
while (++index < length) {
| javascript | {
"resource": ""
} |
q33302 | arrayReduceRight | train | function arrayReduceRight(array, iteratee, accumulator, initAccum) {
var length = array.length;
if (initAccum && length) {
accumulator = array[--length];
}
while (length--) {
| javascript | {
"resource": ""
} |
q33303 | baseExtremum | train | function baseExtremum(array, iteratee, comparator) {
var index = -1, length = array.length;
while (++index < length) {
var value = array[index], current = iteratee(value);
if (current != null && (computed === | javascript | {
"resource": ""
} |
q33304 | stringSize | train | function stringSize(string) {
if (!(string && reHasComplexSymbol.test(string))) {
return string.length;
}
var result = reComplexSymbol.lastIndex = | javascript | {
"resource": ""
} |
q33305 | cacheHas | train | function cacheHas(cache, value) {
var map = cache.__data__;
if (isKeyable(value)) {
var data = map.__data__, hash = typeof value == 'string' ? data.string : data.hash;
| javascript | {
"resource": ""
} |
q33306 | baseHas | train | function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of | javascript | {
"resource": ""
} |
q33307 | basePick | train | function basePick(object, props) {
object = Object(object);
return arrayReduce(props, function (result, key) {
if (key in object) { | javascript | {
"resource": ""
} |
q33308 | basePullAll | train | function basePullAll(array, values, iteratee, comparator) {
var indexOf = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values.length, seen = array;
if (iteratee) {
seen = arrayMap(array, baseUnary(iteratee));
}
while (++index < length) {
var fromIn... | javascript | {
"resource": ""
} |
q33309 | indexKeys | train | function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) && (isArray(object) || isString(object) || isArguments(object))) {
| javascript | {
"resource": ""
} |
q33310 | mergeDefaults | train | function mergeDefaults(objValue, srcValue, key, object, source, stack) {
if (isObject(objValue) && isObject(srcValue)) {
| javascript | {
"resource": ""
} |
q33311 | sample | train | function sample(collection) {
var array = isArrayLike(collection) ? collection : values(collection), length = array.length;
| javascript | {
"resource": ""
} |
q33312 | size | train | function size(collection) {
if (collection == null) {
return 0;
}
if (isArrayLike(collection)) {
var result = collection.length;
| javascript | {
"resource": ""
} |
q33313 | isTypedArray | train | function isTypedArray(value) {
return isObjectLike(value) | javascript | {
"resource": ""
} |
q33314 | keys | train | function keys(object) {
var isProto = isPrototype(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object), skipIndexes = !!indexes, result = indexes || [], length = result.length;
for (var key in object) {
i... | javascript | {
"resource": ""
} |
q33315 | parseInt | train | function parseInt(string, radix, guard) {
// Chrome fails to trim leading <BOM> whitespace characters.
// See https://code.google.com/p/v8/issues/detail?id=3109 for more details.
| javascript | {
"resource": ""
} |
q33316 | words | train | function words(string, pattern, guard) {
string = toString(string);
pattern = guard ? undefined : pattern;
if (pattern === undefined) {
| javascript | {
"resource": ""
} |
q33317 | mixin | train | function mixin(object, source, options) {
var props = keys(source), methodNames = baseFunctions(source, props);
if (options == null && !(isObject(source) && (methodNames.length || !props.length))) {
options = source;
source = object;
object = this;
methodNames = b... | javascript | {
"resource": ""
} |
q33318 | subtract | train | function subtract(minuend, subtrahend) {
var result;
if (minuend === undefined && subtrahend === undefined) {
return 0;
}
if (minuend !== undefined) {
result = minuend;
}
| javascript | {
"resource": ""
} |
q33319 | onWindowLoad | train | function onWindowLoad() {
self.isLoaded = true;
onPluginStart();
if (windowLoadListenderAttached) {
| javascript | {
"resource": ""
} |
q33320 | isCordova | train | function isCordova() {
var isCordova = null;
var idxIsCordova = window.location.search.indexOf('isCordova=');
if (idxIsCordova >= 0) {
var isCordova = window.location.search.substring(idxIsCordova + 10);
if (isCordova.indexOf('&') >= 0) | javascript | {
"resource": ""
} |
q33321 | createAccessors | train | function createAccessors(keys) {
var fname;
lodash.forEach(keys, function(key) {
key.replace(/[^\w\d-]/g, '');
// get<key>
fname = createFnName('get', key);
self[fname] = function() {
return getKey(ns + key);
};
// set<key>
fname = createF... | javascript | {
"resource": ""
} |
q33322 | timeout | train | function timeout(message) {
$log.warn('Plugin client request timeout: ' + serialize(message));
var promiseIndex = lodash.findIndex(promises, function(promise) {
return promise.id == message.header.id;
});
if (promiseIndex >= 0) {
var promise = lodash.pullAt(promises, promiseIndex);
... | javascript | {
"resource": ""
} |
q33323 | transport | train | function transport(message) {
return {
header: message.header, | javascript | {
"resource": ""
} |
q33324 | match | train | function match(mapEntry, request, route) {
var keys = [];
var m = pathToRegexpService.pathToRegexp(mapEntry.path, keys).exec(request.url);
if (!m) {
return false;
}
if (mapEntry.method != request.method) {
return false;
}
route.params = {};
| javascript | {
"resource": ""
} |
q33325 | setConfig | train | function setConfig(configs) {
configProperties = platformConfigs;
provider.platform[platformName] = {};
addConfig(configProperties, configProperties.platform[platformName]);
| javascript | {
"resource": ""
} |
q33326 | train | function(app) {
this._super(app);
const vendorTree = this.treePaths.vendor;
// Import the PubNub package and shim.
app.import(`${vendorTree}/pubnub.js`);
| javascript | {
"resource": ""
} | |
q33327 | train | function(vendorTree) {
const pubnubPath = path.dirname(require.resolve('pubnub/dist/web/pubnub.js'));
const pubnubTree = new Funnel(pubnubPath, {
src: 'pubnub.js',
| javascript | {
"resource": ""
} | |
q33328 | defaultProps | train | function defaultProps( target, overwrite )
{
overwrite = overwrite || {};
for( var prop in overwrite ) {
if( target.hasOwnProperty(prop) && _isValid( overwrite[ | javascript | {
"resource": ""
} |
q33329 | train | function(action, weight) {
if(weight===undefined) {
weight=0;
}
| javascript | {
"resource": ""
} | |
q33330 | train | function () {
var tasks = this.tasks.sort(function(a,b) {
if (a.weight < b.weight) {
return -1;
} if (a.weight > b.weight) {
return 1;
}
return 0;
| javascript | {
"resource": ""
} | |
q33331 | throwWapper | train | function throwWapper( callback ) {
return function( resultSet ) {
callback(
resultSet.err || null,
resultSet.err ? null : resultSet.result,
...resultSet.argument
| javascript | {
"resource": ""
} |
q33332 | init | train | function init(schema, name) { // {{{2
/**
* Kind constructor
*
* @param schema {Object|String} Schema containing the kind
* @param name {String} Unique kind name within the schema
*
* @method constructor
*/
this.name = name; // {{{3
/**
* Kind name unique within a schema
*
* @property name
* @... | javascript | {
"resource": ""
} |
q33333 | isException | train | function isException(url, exceptions) {
if (exceptions && Array.isArray(exceptions)) {
for (let i = 0; i < exceptions.length; | javascript | {
"resource": ""
} |
q33334 | preCast | train | function preCast(value, parameterDefinition) {
switch (parameterDefinition.type) {
case 'array': {
let values;
switch (parameterDefinition.collectionFormat) {
case 'ssv':
values = value.split(' ');
break;
case 'tsv':
values = value.split('\t');
break;
case 'pipes':
values ... | javascript | {
"resource": ""
} |
q33335 | postCast | train | function postCast(value, parameterDefinition) {
const type = parameterDefinition.type;
const format = parameterDefinition.format;
if (type === 'string' && (format === 'date' | javascript | {
"resource": ""
} |
q33336 | gridMesh | train | function gridMesh(nx, ny, origin, dx, dy) {
//Unpack default arguments
origin = origin || [0,0]
if(!dx || dx.length < origin.length) {
dx = dup(origin.length)
if(origin.length > 0) {
dx[0] = 1
}
}
if(!dy || dy.length < origin.length) {
dy = dup(origin.length)
if(origin.length > 1) {
... | javascript | {
"resource": ""
} |
q33337 | buildEntitiesLookup | train | function buildEntitiesLookup(items, radix) {
var i, chr, entity, lookup = {};
if (items) {
items = items.split(',');
radix = radix || 10;
// Build entities lookup table
for (i = 0; i < items.length; i += 2) {
chr... | javascript | {
"resource": ""
} |
q33338 | train | function(text, attr) {
return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {
| javascript | {
"resource": ""
} | |
q33339 | train | function(text, attr, entities) {
entities = entities || namedEntities;
return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) {
| javascript | {
"resource": ""
} | |
q33340 | addValidChildren | train | function addValidChildren(validChildren) {
var childRuleRegExp = /^([+\-]?)(\w+)\[([^\]]+)\]$/;
// Invalidate the schema cache if the schema is mutated
mapCache[settings.schema] = null;
validChildren && each(split(validChildren, ','), function(rule) {
... | javascript | {
"resource": ""
} |
q33341 | train | function(node) {
var self = this;
node.parent && node.remove();
self.insert(node, self); | javascript | {
"resource": ""
} | |
q33342 | train | function() {
var i, l, selfAttrs, selfAttr, cloneAttrs, self = this,
clone = new Node(self.name, self.type);
// Clone element attributes
if (selfAttrs = self.attributes) {
cloneAttrs = [];
cloneAttrs.map = {};
... | javascript | {
"resource": ""
} | |
q33343 | train | function(wrapper) {
var self = this;
self.parent.insert(wrapper, self); | javascript | {
"resource": ""
} | |
q33344 | train | function() {
var node, next, self = this;
for (node = self.firstChild; node;) {
next = node.next;
| javascript | {
"resource": ""
} | |
q33345 | train | function(name) {
var node, self = this,
collection = [];
for (node = self.firstChild; node; node = walk(node, self)) {
| javascript | {
"resource": ""
} | |
q33346 | train | function() {
var nodes, i, node, self = this;
// Remove all children
if (self.firstChild) {
nodes = [];
// Collect the children
for (node = self.firstChild; node; node = walk(node, self)) {
... | javascript | {
"resource": ""
} | |
q33347 | compress2 | train | function compress2(target, a, b, c) {
if (!canCompress(a)) {
return;
}
if (!canCompress(b)) {
return;
}
| javascript | {
"resource": ""
} |
q33348 | train | function(styles, elementName) {
var name, value, css = '';
function serializeStyles(name) {
var styleList, i, l, value;
styleList = validStyles[name];
if (styleList) {
for (i = 0,... | javascript | {
"resource": ""
} | |
q33349 | find | train | function find(selector) {
var arr = [], $ = this.air, slice = this.slice;
this.each(function(el) {
arr | javascript | {
"resource": ""
} |
q33350 | fv | train | function fv(vals, key) {
if (!vals) return;
vals.forEach(function(v) {
if (v.key === key | javascript | {
"resource": ""
} |
q33351 | hasMatchingJadeFileInPages | train | function hasMatchingJadeFileInPages(srcDir, url, pages, jadeOptions, callback) {
if (typeof pages[url] === 'undefined') {
// get the possible jade file path
var extension = path.extname(url);
var jadeFilePath;
var htmlFilePath;
if (extension === ".html" /* || extension === ".... | javascript | {
"resource": ""
} |
q33352 | train | function( input, null_text ) {
if ( input == null || input === undefined ) return null_text || '';
if ( typeof input === 'object' && Object.prototype.toString.call(input) === '[object Date]' ) return input.toDateString();
| javascript | {
"resource": ""
} | |
q33353 | train | function( name, value, options, checked ) {
options = options || {};
| javascript | {
"resource": ""
} | |
q33354 | range | train | function range(start, stop) {
if (arguments.length <= 1) {
stop = start || 0;
start = 0;
}
var length = Math.max(stop - start, 0);
var idx = 0;
var arr = new Array(length); | javascript | {
"resource": ""
} |
q33355 | train | function(n) {
// n is out of range, don't do anything
if (n > this.props.numPages || n < 1) return;
| javascript | {
"resource": ""
} | |
q33356 | archify | train | function archify (scripts, alpha) {
let names = Object.keys(scripts)
if (alpha) {
names = names.sort()
}
return {
| javascript | {
"resource": ""
} |
q33357 | isLifeCycleScript | train | function isLifeCycleScript (prefix, name, scripts) {
const re = new RegExp("^" + prefix)
const root = name.slice(prefix.length)
return | javascript | {
"resource": ""
} |
q33358 | getRunAllScripts | train | function getRunAllScripts (cmd) {
const re = RegExp("(?:npm-run-all" + RE_FLAGS + RE_NAMES + ")+", "gi")
const cmds = getMatches(re, cmd).map(m =>
// clean spaces
| javascript | {
"resource": ""
} |
q33359 | onProcCallGet | train | function onProcCallGet(method, path, args) {
// log('onProcCallGet('+JSON.stringify(arguments));
let pathSplit = path.split('/');
const serviceid = pathSplit.shift();
const propname = pathSplit.join('/');
const bInfo = (args.info === 'true');
if (serviceid == '') { // access 'admin/' => servic... | javascript | {
"resource": ""
} |
q33360 | listNetInterfaces | train | function listNetInterfaces() {
return new Promise((ac, rj) => {
exec('nmcli d', (err, stdout, stderr) => {
const lines = stdout.split('\n');
if (err || lines.length<2) {
rj({error: 'No network available.'});
return;
}
lines.shi... | javascript | {
"resource": ""
} |
q33361 | routeSet | train | async function routeSet(target, netInterface, rootPwd) {
const connName = await searchConnNameFromNetworkInterface(netInterface);
const prevRoutes = await searchPrevRoutes(target);
if (prevRoutes.length == 1) {
if (prevRoutes[0].connName === connName &&
prevRoutes[0].target === target &&... | javascript | {
"resource": ""
} |
q33362 | routeDelete | train | async function routeDelete(target, rootPwd) {
const prevRoutes = await searchPrevRoutes(target);
if (prevRoutes.length == 0) {
return; // no need to do anything
}
const cmds = [];
for (const prevRoute of prevRoutes) {
cmds.push([
'nmcli', 'connection', 'modify', prevRoute... | javascript | {
"resource": ""
} |
q33363 | listConnections | train | async function listConnections() {
const connList = await executeCommand(
['nmcli', '-f', 'NAME,DEVICE', '-t', 'connection', 'show']);
const | javascript | {
"resource": ""
} |
q33364 | searchPrevRoutes | train | async function searchPrevRoutes(target) {
const connNames = await listConnectionNames();
const ret = [];
for (const connName of connNames) {
const cmd = [
'nmcli', '-f', 'IP4.ROUTE', 'connection', 'show', connName,
];
const output = await executeCommand(cmd);
for ... | javascript | {
"resource": ""
} |
q33365 | searchConnNameFromIP | train | async function searchConnNameFromIP(ip) { // eslint-disable-line no-unused-vars
const connNames = await listConnectionNames();
const gipnum = ipv4.convToNum(ip);
for (const connName of connNames) {
const cmd = [
'nmcli', '-f', 'IP4.ADDRESS', 'connection', 'show', connName,
];
... | javascript | {
"resource": ""
} |
q33366 | searchConnNameFromNetworkInterface | train | async function searchConnNameFromNetworkInterface(netInterface) { // eslint-disable-line no-unused-vars
const conns = await listConnections();
for (const [connName, nif] of Object.entries(conns)) {
| javascript | {
"resource": ""
} |
q33367 | executeCommand | train | function executeCommand(cmd, option) {
option = option || {};
return new Promise((ac, rj)=>{
let okMsg = '';
let erMsg='';
log('Exec:'+cmd.join(' '));
let child;
if (option.sudo) {
child = sudo(cmd, {password: option.password});
} else {
ch... | javascript | {
"resource": ""
} |
q33368 | executeCommands | train | async function executeCommands(commands, ignoreErrorFunc, option) {
const ret = [];
for (const cmd of commands) {
const r = await executeCommand(cmd, option).catch((e) => {
if (ignoreErrorFunc && ignoreErrorFunc(cmd)) {
| javascript | {
"resource": ""
} |
q33369 | search | train | function search(req, res, next) {
res.__apiMethod = 'search';
buildQuery.call(this, req).exec(function (err, obj) {
if (err) {
var isCastError =
(err.name === 'CastError') ||
(err.message && err.message[0] === '$') ||
(err.message === 'and needs an array')
;
| javascript | {
"resource": ""
} |
q33370 | installModule | train | function installModule (module, modulesDir, callback) {
let details = module.split('/');
let devModulePath = resolve(modulesDir, module);
fs.access(resolve(modulesDir, module), err => {
// skip next steps if module already exists
if (!err || err.code !== 'ENOENT') {
return cal... | javascript | {
"resource": ""
} |
q33371 | setupSymlinks | train | function setupSymlinks (module, modulesDir, callback) {
let details = module.split('/');
let modulePath = resolve(NODE_MODULES, details[1]);
let devModulePath = resolve(modulesDir, module);
rimraf(modulePath, err => {
if (err) {
return callback(err); | javascript | {
"resource": ""
} |
q33372 | watchModule | train | function watchModule (module, modulesDir) {
const pathToModule = resolve(modulesDir, module);
const pathToHandlers = resolve(HANDLER_BASE, module);
modules[module] = {
handlers: []
};
fs.readdir(pathToHandlers, (err, files) => {
if (err) {
return console.log(new Error... | javascript | {
"resource": ""
} |
q33373 | bundleHandler | train | function bundleHandler (pathToHandlers, module, file) {
// only rebundle if js file changed
if (file.length < 3 || file.indexOf('bundle.') === 0 || file.substr(file.length - 3) !== '.js') {
return;
}
// only rebundle if handler was already bundled before
fs.access(pathToHandlers + '/bundle... | javascript | {
"resource": ""
} |
q33374 | remoteRequest | train | function remoteRequest(moduleName, methodName, argsArr) {
// TODO: Handle moduleName properly
// TODO: Better ID generation
const id = Math.floor(Math.random() * 10000000);
const serializedRequest = serializer.request(id, methodName, argsArr);
| javascript | {
"resource": ""
} |
q33375 | train | function () {
var self = this;
base._create.apply(self, arguments);
if (self.options.actions.listAction) {
self._adaptListActionforAbp();
}
if (self.options.actions.createAction) {
| javascript | {
"resource": ""
} | |
q33376 | train | function () {
var self = this;
var originalListAction = self.options.actions.listAction;
self.options.actions.listAction = function (postData, jtParams) {
return $.Deferred(function ($dfd) {
var input = $.extend({}, postData, {
... | javascript | {
"resource": ""
} | |
q33377 | train | function () {
var self = this;
var originalCreateAction = self.options.actions.createAction;
self.options.actions.createAction = function (postData) {
return $.Deferred(function ($dfd) {
var input = $.extend({}, postData);
ori... | javascript | {
"resource": ""
} | |
q33378 | train | function () {
var self = this;
var originalUpdateAction = self.options.actions.updateAction;
self.options.actions.updateAction = function (postData) {
return $.Deferred(function ($dfd) {
var input = $.extend({}, postData);
ori... | javascript | {
"resource": ""
} | |
q33379 | train | function () {
var self = this;
var originalDeleteAction = self.options.actions.deleteAction;
self.options.actions.deleteAction = function (postData) {
return $.Deferred(function ($dfd) {
var input = $.extend({}, postData);
ori... | javascript | {
"resource": ""
} | |
q33380 | options | train | function options(req, res) {
res.__apiMethod = 'options';
| javascript | {
"resource": ""
} |
q33381 | MongoCache | train | function MongoCache(options) {
options = options || {};
var url = options.url || 'http://localhost/openam-agent',
expireAfterSeconds = options.expireAfterSeconds || 60,
collectionName = options.collectionName || 'agentcache';
this.collection = mongodb.MongoClient.connectAsync(url).then(fun... | javascript | {
"resource": ""
} |
q33382 | append | train | function append() {
var i, l = this.length, el, args = this.slice.call(arguments);
function it(node, index) {
// content elements to insert
el.each(function(ins) {
ins = (index < (l - 1)) ? ins.cloneNode(true) : ins;
node.appendChild(ins);
});
}
for(i = | javascript | {
"resource": ""
} |
q33383 | rotate | train | function rotate(cb) {
var retryCount
var newName
if (self.writable && didWrite && !rotating) { // we wrote something to the log, and are not in process of rotating
rotating = true
retryCount = 0
newName = getRotatedName()
fs.stat(newName, doesNewNameExist) // see if the new filename already exist
}... | javascript | {
"resource": ""
} |
q33384 | resolve | train | function resolve(obj, propstr, default_val){
// special case, no test and assignment needed for optional default_val; we don't mind if default_val is undefined!
// note: eval called on propstr!
var rv;
if(obj === undefined){
rv = default_val;
} else if(obj.hasOwnProperty... | javascript | {
"resource": ""
} |
q33385 | loadMonaco | train | function loadMonaco(monaco) {
var deps = [
'vs/editor/editor.main.nls',
'vs/editor/editor.main'
];
charto.monaco = monaco;
// Monaco loader sets exports, then gets confused by them.
exports | javascript | {
"resource": ""
} |
q33386 | updateCollected | train | function updateCollected(err, result) {
if (typeof result !== 'object') {
collection.err = collection.err || new Error('Invalid acrhitect plugin format');
return;
}
collection.err = collection.err || err;
if (!collection.loaded) {
... | javascript | {
"resource": ""
} |
q33387 | _resolvePackageSync | train | function _resolvePackageSync(base, relativePath) {
var packageJsonPath;
var packagePath;
// try to fetch node package
try {
packageJsonPath = _resolvePackagePathSync(base, PATH.join(relativePath, 'package.json'));
packagePath = dirname(packageJsonPath);
} catch (err) {
if (e... | javascript | {
"resource": ""
} |
q33388 | _resolvePackagePathSync | train | function _resolvePackagePathSync(base, relativePath) {
var originalBase = base;
if (!(base in packagePathCache)) {
packagePathCache[base] = {};
}
var cache = packagePathCache[base];
if (relativePath in cache) {
return cache[relativePath];
}
var packagePath;
if (relative... | javascript | {
"resource": ""
} |
q33389 | _$updateRecord | train | function _$updateRecord(name, obj, mode = 'shallow', lockedKeys = [], protectedKeys = []) {
if (!Object.keys(updateModes).includes(mode)) throw new TypeError('Unsupported mode');
lockedKeys.push(this.datasetRecordIdKey);
if (mode === 'shallow') return this.record._$updateRecordShallowP(name, obj, lockedKeys);
i... | javascript | {
"resource": ""
} |
q33390 | train | function(stream, post) {
this._credentials = [];
this._status = {};
this._modules = {
stream: stream | javascript | {
"resource": ""
} | |
q33391 | QueryConfig | train | function QueryConfig (req, res, config) {
var sort = req.query.sort
var order = req.query.order
var select = req.query.select
var skip = req.query.skip
var limit = req.query.limit
var page = req.query.page
var perPage = config.perPage || 10
var idAttribute = config.idParam ? req.params[config.idParam] :... | javascript | {
"resource": ""
} |
q33392 | train | function (color, angle) {
var hsl, color0, color2;
if (!angle) {
angle = 30;
}
hsl = ColorHelper.rgbToHSL(color);
hsl[0] = (hsl[0] + angle) % 360;
color0 = ColorHelper.hslToHexColor(hsl);
color0 = ColorHelper.darken(color0, 8);
color0 = ColorHelper.saturate(color0, -6);
hsl | javascript | {
"resource": ""
} | |
q33393 | train | function (startColor, endColor, count) {
var lightness,
hsl = ColorHelper.rgbToHSL(startColor);
if (count === undefined) {
count = endColor;
lightness = hsl[2] - 20 * count;
if (lightness < 0) {
lightness = 100 - hsl[2];
}
endColor = | javascript | {
"resource": ""
} | |
q33394 | oncurlyclose | train | function oncurlyclose(state, curly, suber) {
curly.count--;
if (suber.protostring && curly.count === | javascript | {
"resource": ""
} |
q33395 | get | train | function get(cache, keys) {
if (keys.length === 0) {
return cache.get(sentinel);
}
const [key, ...restKeys] = keys;
const nestedCache = cache.get(key); | javascript | {
"resource": ""
} |
q33396 | DataManager | train | function DataManager(hoist, type, bucket) {
this.type = type;
this.hoist = hoist;
| javascript | {
"resource": ""
} |
q33397 | iterateKeys | train | function iterateKeys(keys) {
async.forEach(keys, readKey, function (err) {
| javascript | {
"resource": ""
} |
q33398 | createDirs | train | function createDirs(next) {
if (!options.files || !options.files.length) {
return next();
}
self.ssh({
keys: options.keys,
server: options.server,
tunnel: options.tunnel,
remoteUser: options.remoteUser,
commands: ['mkdir -p ' + options.files.map(functio... | javascript | {
"resource": ""
} |
q33399 | uploadFiles | train | function uploadFiles(next) {
return options.files && options.files.length
? | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.