_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 27 233k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q9400 | rangeBox | train | function rangeBox(selection, label) {
selection
.classed('form-row', true)
.classed('form-group', true)
.classed('align-items-center', true)
.append('div')
.classed('col-form-label', true)
.classed('col-form-label-sm', true)
.text(label);
const minBox = selection.append('div... | javascript | {
"resource": ""
} |
q9401 | getMarketCaps | train | function getMarketCaps() {
return new Promise(function (resolve, reject) {
scraper
.get(urlMarketCap)
| javascript | {
"resource": ""
} |
q9402 | formatResults | train | function formatResults (results) {
return results.map(function (r) {
return {
fullName: r.fullName,
| javascript | {
"resource": ""
} |
q9403 | formatOutput | train | function formatOutput (results) {
var date = new Date()
var commit
try {
commit = execSync('git rev-parse HEAD').toString().replace('\n', '')
} catch (e) {
commit = 'commit hash not found'
}
return {
meta: {
title: 'example benchmark',
version: pkg.version,
| javascript | {
"resource": ""
} |
q9404 | getConversationId | train | function getConversationId(req, res, options) {
var cookieName = options.conversationIdCookieName;
var headerName = options.conversationIdHeader;
var conversationId = req.headers[headerName] || req.cookies && req.cookies[cookieName];
if (!conversationId) {
| javascript | {
"resource": ""
} |
q9405 | makeCallback | train | function makeCallback(entryCaller, entryStack, shadow = false) {
/**
* This callback should be called when an asynchronous error occurred.
* @param {(string|Error)} messageOrError A message string or an _Error_ object at the point of actual error.
* @returns {Error} An error with the updated stack which incl... | javascript | {
"resource": ""
} |
q9406 | train | function(duration, easing) {
var newStylesheet = localnwt.node.create('<style type="text/css"></style>');
easing = easing || 'ease-in';
duration = duration || 1;
var trail = ' ' + duration + 's ' + easing,
// Just support all browsers for now
cssTransitionProperties = {
'-webkit-transition': 'all' + tra... | javascript | {
"resource": ""
} | |
q9407 | train | function(node, styles, duration, easing) {
animation.init(duration, easing);
node.fire('anim:start', [styles, duration, easing])
setTimeout(function(){
| javascript | {
"resource": ""
} | |
q9408 | NWTEventInstance | train | function NWTEventInstance (e, attrs) {
this._e = e;
this.target = new NWTNodeInstance(e.target);
| javascript | {
"resource": ""
} |
q9409 | train | function(attribute, pattern, callback, interaction, maxDepth) {
var classPattern = new RegExp(pattern),
interaction = interaction || 'click',
maxSearch,
dispatcher,
body = localnwt.one('body');
// Currently only search one level for a mouse listener for performance reasons
if (interaction == 'click') {
... | javascript | {
"resource": ""
} | |
q9410 | train | function (implementOn, event, callback) {
var stringy = callback.toString();
if (this._cached[stringy]) {
// Iteratre through the cached callbacks and remove the correct one based on reference
for(var i=0,numCbs=this._cached[stringy].length; i < numCbs; i++) {
| javascript | {
"resource": ""
} | |
q9411 | getExpressionValue | train | function getExpressionValue (varName, scssExpression) {
if (is.undef(scssExpression) || is.args.empty(arguments)) {
message('Error: Missing arguments');
return undefined;
}
if (!is.string(varName) || !is.string(scssExpression)) {
message('Error: Check arguments type');
retur... | javascript | {
"resource": ""
} |
q9412 | extractExpressionValue | train | function extractExpressionValue (css) {
// parse the comment string:
// /*varValue*/ --> varValue
const valueRegExp = /(?:\/\*)(.+)(?:\*\/)/;
const value | javascript | {
"resource": ""
} |
q9413 | getRegion | train | function getRegion() {
const awsRegion = trim(process.env.AWS_REGION); | javascript | {
"resource": ""
} |
q9414 | configureRegion | train | function configureRegion(context) {
// Resolve the AWS region, if it is not already defined on the context
if (!context.region) {
context.region | javascript | {
"resource": ""
} |
q9415 | getOrSetRegionKey | train | function getOrSetRegionKey(region) {
const regionName = region ? region : getRegion();
let regionKey = regionKeysByRegion.get(regionName);
if (!regionKey) {
| javascript | {
"resource": ""
} |
q9416 | transformConfig | train | function transformConfig (config) {
if (config === null || typeof config !== 'object') {
config = {};
}
if (!Object.keys(config).length) {
return {
options: {},
files: {
ignore: [ignoreNodeModules()]
}
};
}
let runConfig = {
options: {
showMaxStack: 0
}
};
if (config.noDisabling) {
... | javascript | {
"resource": ""
} |
q9417 | lintMethod | train | function lintMethod (mtd, file, config, cb, configPath) {
let runConfig = transformConfig(config);
if (typeof cb !== 'function') {
cb = function () {};
}
try {
let results = sassLint[mtd](file, runConfig, configPath);
if (mtd !== 'lintFiles') {
if (!Array.isArray(results)) {
results = [results];
... | javascript | {
"resource": ""
} |
q9418 | install | train | function install(destination, prg, callback) {
prompt.start();
prompt.message = ':'.white.bold.bgBlack;
prompt.delimiter = ': '.white.bold.bgBlack;
var schema = {
properties: {
appName: {
description: 'Application name'.white.bold.bgBlack,
pattern: /^[a-zA-Z0-9\s\-]+$/,
messa... | javascript | {
"resource": ""
} |
q9419 | doInstall | train | function doInstall(settings, destination) {
// Create application directories if they don't exist.
var folders = [
destination,
path.join(destination, '/public'),
path.join(destination, '/extensions')
];
folders.forEach(function(folder) {
if (!fs.existsSync(folder)) {
| javascript | {
"resource": ""
} |
q9420 | createAdminUser | train | function createAdminUser(app, result, callback) {
// Create the admin user.
var User = app.type('user');
var userData = {
username: result.adminName,
password: result.adminPass,
| javascript | {
"resource": ""
} |
q9421 | train | function () {
// Allow using a function or an object
var events = _.result(this, 'dispatcherEvents');
if (_.isUndefined(events) || _.isEmpty(events)) {
// Bug out early if no dispatcherEvents
return;
}
var registrations = {};
_.each(events, function (funcOrName, actionType) {
... | javascript | {
"resource": ""
} | |
q9422 | getActions | train | function getActions( state, resource ) {
var list = state.actionList[ resource.name ] = [];
_.each( resource.actions, function( action, actionName ) { | javascript | {
"resource": ""
} |
q9423 | getArguments | train | function getArguments( fn ) {
return _.isFunction( fn ) ? trim( /[(]([^)]*)[)]/.exec( | javascript | {
"resource": ""
} |
q9424 | loadAll | train | function loadAll( state, resourcePath ) {
var loadActions = [ loadResources( state, resourcePath ) ] || [];
if ( state.config.modules ) {
_.each( state.config.modules, function( mod ) {
var modPath;
if ( /[\/]/.test( mod ) ) {
modPath = require.resolve( path.resolve( process.cwd(), mod ) );
} else {
... | javascript | {
"resource": ""
} |
q9425 | loadModule | train | function loadModule( state, resourcePath ) {
try {
var key = path.resolve( resourcePath );
delete require.cache[ key ];
var modFn = require( resourcePath );
var args = getArguments( modFn );
args.shift();
if ( args.length ) {
return state.fount.resolve( args )
.then( function( deps ) {
var argL... | javascript | {
"resource": ""
} |
q9426 | loadResources | train | function loadResources( state, filePath ) {
var resourcePath = path.resolve( process.cwd(), filePath );
return getResources( resourcePath )
.then( function( list ) {
return when.all( _.map( _.filter( list ), loadModule.bind( | javascript | {
"resource": ""
} |
q9427 | train | function(other) {
var me = this.region(),
you = other.region();
return !(
me.left > you.right ||
me.right < you.left ||
me.top > you.bottom ||
me.bottom < you.top ||
| javascript | {
"resource": ""
} | |
q9428 | train | function(selector) {
var allMatches = localnwt.all(selector),
testNode = this._node,
ancestor = null,
maxDepth = 0;
if( allMatches.size() == 0 ) {
return null;
}
while( true ) {
// Iterate through all matches for each parent, and exit as soon as we have a match
// Pretty bad performance, but super s... | javascript | {
"resource": ""
} | |
q9429 | train | function(property) {
if( property === 'parentNode' ) {
var node = this._node[property];
if( !node ) { return null; } | javascript | {
"resource": ""
} | |
q9430 | train | function(property) {
if( !this.getAttribute('style') ) {
return '';
}
property = this._jsStyle(property); | javascript | {
"resource": ""
} | |
q9431 | train | function(props) {
// Default properties to an array
if (typeof props == 'string') {
props = [props];
}
var i,
propsLen = props.length;
for (i = 0; | javascript | {
"resource": ""
} | |
q9432 | train | function(newStyles) {
if( !this.getAttribute('style') ) {
this.setAttribute('style', '');
}
var newStyle = '',
// If the style matches one of the following, and we pass in an integer, default the unit
// E.g., 10 becomes 10px
defaultToUnit = {
top: 'px',
left: 'px',
width: 'px',
height: 'px'
... | javascript | {
"resource": ""
} | |
q9433 | train | function() {
var retVal = '',
// Getting ALL elements inside of form element
els = this._node.getElementsByTagName('*');
// Looping through all elements inside of form and checking to see if they're "form elements"
for( var i = 0, el; el = els[i]; i++ ) {
if( !el.disabled && el.name && el.n... | javascript | {
"resource": ""
} | |
q9434 | train | function(method, criteria) {
// Iterate on the raw node
var node = this._node,
// Method to iterate on
siblingType = method + 'Sibling',
// Filter to test the node
filter,
validItems;
// CSS Selector case
if (typeof criteria == "string") {
validItems = n.all(criteria);
filter = function(rawNode) {... | javascript | {
"resource": ""
} | |
q9435 | train | function(node) {
var newParent = ( node instanceof NWTNodeInstance ) ? node : | javascript | {
"resource": ""
} | |
q9436 | train | function(node) {
if( node instanceof NWTNodeInstance ) {
node = node._node;
}
var child = this.one('*');
| javascript | {
"resource": ""
} | |
q9437 | train | function(node, position) {
var newParent = ( node instanceof NWTNodeInstance | javascript | {
"resource": ""
} | |
q9438 | train | function(node, position) {
position = position || 'before';
if( position == 'before' ) {
this._node.parentNode.insertBefore(node._node, this._node);
} else if ( position == 'after' | javascript | {
"resource": ""
} | |
q9439 | train | function(event, fn, selector, context) {
return localnwt.event.on(this, | javascript | {
"resource": ""
} | |
q9440 | train | function(type, callback, recurse) {
var evt = localnwt.event;
for (var i in evt._cached) {
for(var j=0,numCbs=evt._cached[i].length; j < numCbs; j++) {
var thisEvt = evt._cached[i][j];
if (this._node == thisEvt.obj._node && (!type || type == thisEvt.type)) {
| javascript | {
"resource": ""
} | |
q9441 | train | function(styles, duration, easing, pushState) {
if (!pushState) {
var styleAttrs = [],
defaultStyles,
animHistory,
i
for (i in styles) {
styleAttrs.push(i)
}
defaultStyles = this.computeCss(styleAttrs)
| javascript | {
"resource": ""
} | |
q9442 | train | function(plugin, config) {
config = config || | javascript | {
"resource": ""
} | |
q9443 | getArnComponent | train | function getArnComponent(arn, index) {
const components = isNotBlank(arn) | javascript | {
"resource": ""
} |
q9444 | getKinesisShardIdFromEventID | train | function getKinesisShardIdFromEventID(eventID) {
if (eventID) {
const sepPos = eventID.indexOf(':');
return sepPos | javascript | {
"resource": ""
} |
q9445 | getKinesisShardIdAndEventNoFromEventID | train | function getKinesisShardIdAndEventNoFromEventID(eventID) {
if (eventID) {
const sepPos = eventID.indexOf(':');
| javascript | {
"resource": ""
} |
q9446 | getKinesisSequenceNumber | train | function getKinesisSequenceNumber(record) {
return record && record.kinesis && | javascript | {
"resource": ""
} |
q9447 | getDynamoDBSequenceNumber | train | function getDynamoDBSequenceNumber(record) {
return record && record.dynamodb && | javascript | {
"resource": ""
} |
q9448 | _validateKinesisStreamEventRecord | train | function _validateKinesisStreamEventRecord(record) {
if (!record.kinesis) {
throw new Error(`Missing kinesis property for Kinesis stream event record (${record.eventID})`);
}
if (!record.kinesis.data) {
throw new Error(`Missing data property for Kinesis stream event record (${record.eventID})`);
}
if ... | javascript | {
"resource": ""
} |
q9449 | isDynamoDBEventNameValid | train | function isDynamoDBEventNameValid(recordOrEventName) {
const eventName = recordOrEventName.eventName ? recordOrEventName.eventName | javascript | {
"resource": ""
} |
q9450 | _validateDynamoDBStreamEventRecord | train | function _validateDynamoDBStreamEventRecord(record) {
if (!isDynamoDBEventNameValid(record)) {
throw new Error(`Invalid eventName property (${record.eventName}) for DynamoDB stream event record (${record.eventID})`);
}
if (!record.dynamodb) {
throw new Error(`Missing dynamodb property for DynamoDB stream ... | javascript | {
"resource": ""
} |
q9451 | createRenderStream | train | function createRenderStream(params) {
return new Transform({
decodeStrings: params.decodeStrings || false,
highWaterMark: params.highwaterMark || 16384,
transform(svgStr, encoding, cb) {
const renderBuf = Buffer.alloc(params.width * params.height * 4); // ARGB | javascript | {
"resource": ""
} |
q9452 | train | function (patterns) {
// External restources have to be 1:1 dest to src, both strings
// Check for external first, otherwise expand the pattern
if (!_.isArray(patterns)) {
if (isExternal(patterns)) {
return | javascript | {
"resource": ""
} | |
q9453 | train | function(files) {
var regex;
if (options.webroot instanceof RegExp) {
regex = options.webroot;
} else { | javascript | {
"resource": ""
} | |
q9454 | md5 | train | function md5(files) {
var hash = crypto.createHash('md5');
_.each(files, function(file) {
if (!isExternal(file))
| javascript | {
"resource": ""
} |
q9455 | train | function(command, callback) {
command = 'curl https://api.spark.io/v1/devices/' + this.config.deviceId + '/' + command + '?access_token=' + this.config.token;
this.debug('Running command: ', command);
child = exec(command,
| javascript | {
"resource": ""
} | |
q9456 | traverse | train | function traverse(input, strict) {
if (strict === undefined) strict = true;
if (type(input) === 'object') {
return traverseObject(input, strict); | javascript | {
"resource": ""
} |
q9457 | traverseObject | train | function traverseObject(obj, strict) {
Object.keys(obj).forEach(function(key) | javascript | {
"resource": ""
} |
q9458 | traverseArray | train | function traverseArray(arr, strict) {
arr.forEach(function(value, | javascript | {
"resource": ""
} |
q9459 | standardizeCols | train | function standardizeCols(columns) {
/**
* Gets the default column name
*/
function getDefaultFormatter(colName) {
return function(o) {
return o[colName];
};
}
/**
* Gets the default column sorter
*/
function getDefaultSorter(colName) {
return function(a, b, dir){
var
firstRec = dir == '... | javascript | {
"resource": ""
} |
q9460 | getDefaultSorter | train | function getDefaultSorter(colName) {
return function(a, b, dir){
var
firstRec = dir == 'asc' ? a : b,
secondRec = dir == 'asc' ? b : a,
fA = firstRec[colName].toLowerCase(),
| javascript | {
"resource": ""
} |
q9461 | JSONDataSource | train | function JSONDataSource(config) {
// Default to the first col ASC for sorting
this.colSortIdx | javascript | {
"resource": ""
} |
q9462 | IODataSource | train | function IODataSource(config) {
this.columns = standardizeCols(config.columns);
this.io = config.data;
this.node = config.node;
| javascript | {
"resource": ""
} |
q9463 | ElementDataSource | train | function ElementDataSource(config) {
var newData = [],
newColumns = [];
var headings = config.data.all('tr th');
headings.each(function(th){
newColumns.push(th.getHtml());
});
config.data.all('tr').each(function(tr){
var newRow = {},
populated = | javascript | {
"resource": ""
} |
q9464 | train | function(el) {
var mythis = this;
this.source.colSortIdx = el.data('col-idx');
this.source.columns[el.data('col-idx')].dir = this.source.columns[el.data('col-idx')].dir == 'asc' | javascript | {
"resource": ""
} | |
q9465 | train | function() {
var self = this;
// Populate table html
var content = ['<table class="' + this.tableClass + '" data-instance="' + this.instanceCount + '"><thead>',
'<tr>'];
for (var i in this.source.columns) {
var sortContent = this.source.columns[i].name,
colDir = self.source.columns[i].dir;
... | javascript | {
"resource": ""
} | |
q9466 | train | function (el) {
var opts = {}, ii, p,
opts_arr = (el.attr('data-options') || ':').split(';'),
opts_len = opts_arr.length;
function isNumber (o) {
return ! isNaN (o-0) && o !== null && o !== "" && o !== false && o !== true;
}
function trim(str) {
... | javascript | {
"resource": ""
} | |
q9467 | getAllItems | train | function getAllItems() {
return new Promise(resolve => {
const res = [];
return instance.pkgs.then(db => {
db.transaction(db.name)
.objectStore(db.name).openCursor()
.onsuccess = event => {
const cursor = event.target.result;
| javascript | {
"resource": ""
} |
q9468 | getItem | train | function getItem(id) {
return new Promise((resolve, reject) => {
return instance.pkgs.then(db => {
const req = db.transaction(db.name)
.objectStore(db.name).get(id);
req.onsuccess = | javascript | {
"resource": ""
} |
q9469 | putItem | train | function putItem(value) {
return new Promise((resolve, reject) => {
return instance.pkgs.then(db => {
const obj = db.transaction(db.name, 'readwrite')
.objectStore(db.name);
const req | javascript | {
"resource": ""
} |
q9470 | updateItem | train | function updateItem(id, updater) {
return new Promise((resolve, reject) => {
return instance.pkgs.then(db => {
const obj = db.transaction(db.name, 'readwrite')
.objectStore(db.name);
const req = obj.get(id);
req.onerror = event => reject(event);
req.onsuccess = event => {
c... | javascript | {
"resource": ""
} |
q9471 | deleteItem | train | function deleteItem(id) {
return new Promise((resolve, reject) => {
return instance.pkgs.then(db => {
const req = db.transaction(db.name, 'readwrite')
.objectStore(db.name).delete(id);
| javascript | {
"resource": ""
} |
q9472 | getView | train | function getView(id, viewID) {
return getItem(id)
| javascript | {
"resource": ""
} |
q9473 | appendView | train | function appendView(id, viewID, viewObj) {
return updateItem(id, item => {
const pos = item.views.findIndex(e => | javascript | {
"resource": ""
} |
q9474 | deleteView | train | function deleteView(id, viewID) {
return updateItem(id, item => {
const pos = item.views.findIndex(e => e.viewID === viewID);
item.views.splice(pos, 1);
// prune orphaned collections
const bin = {};
item.dataset.forEach(e => { bin[e.collectionID] = 0; });
item.views.forEach(view => {
['r... | javascript | {
"resource": ""
} |
q9475 | getAllCollections | train | function getAllCollections() {
return getAllItems()
.then(items => _.flatten(
items.map(item => {
return item.dataset.map(coll => {
| javascript | {
"resource": ""
} |
q9476 | getCollection | train | function getCollection(id, collID) {
return getItem(id)
| javascript | {
"resource": ""
} |
q9477 | newNetwork | train | function newNetwork(instance, nodesID, nodesName, response) {
const viewID = misc.uuidv4().slice(0, 8);
const edgesID = response.workflowID.slice(0, 8);
return updateItem(instance, item => {
item.views.push({
$schema: "https://mojaie.github.io/kiwiii/specs/network_v1.0.json",
viewID: viewID,
... | javascript | {
"resource": ""
} |
q9478 | getAsset | train | function getAsset(key) {
return new Promise((resolve, reject) => {
return instance.assets.then(db => {
const req = db.transaction(db.name)
.objectStore(db.name).get(key);
req.onsuccess = event => {
const undef = event.target.result === undefined;
const value = | javascript | {
"resource": ""
} |
q9479 | putAsset | train | function putAsset(key, content) {
return new Promise((resolve, reject) => {
return instance.assets.then(db => {
const obj = db.transaction(db.name, 'readwrite')
.objectStore(db.name);
const req | javascript | {
"resource": ""
} |
q9480 | updateLegendGroup | train | function updateLegendGroup(selection, viewBox, orient) {
const widthFactor = 0.2;
const scaleF = viewBox.right * widthFactor / 120;
const o = orient.split('-');
const viewW = viewBox.right;
const viewH = viewBox.bottom;
const legW = viewW * widthFactor;
const legH = legW * 50 / 120;
const posX = {left: ... | javascript | {
"resource": ""
} |
q9481 | loadKeyValueCSV | train | function loadKeyValueCSV (filename, callback) {
var out = {}
csv()
.from.path(filename, {
delimiter: '\t'
})
.on('record', function (data, index) {
if (data[0].match(/^[\w\d]/)) {
out[data[0]] = | javascript | {
"resource": ""
} |
q9482 | loadStructureCSV | train | function loadStructureCSV (filename, callback) {
var out = {}
csv()
.from.path(filename, {
delimiter: '\t'
})
.transform(function (data) {
// hex values to decimal
if (!data[0].match(/^[0-9A-Fa-f]/)) { return false } // comment
var ret = {
field: parseInt(data[3]),
type: data[2].... | javascript | {
"resource": ""
} |
q9483 | initializeClickimages | train | function initializeClickimages() {
var elements = document.querySelectorAll('[data-pins]');
for(var i = 0; i < elements.length; i++) {
/*
try/catch so it continues with the next element without breaking
out of the loop, when any syntax error occurs.
*/
| javascript | {
"resource": ""
} |
q9484 | train | function (events, context) {
if (!_.isObject(events)) {
console.warn('Only registration objects can be passed to dispatcher.register()');
return;
| javascript | {
"resource": ""
} | |
q9485 | train | function (type, data) {
if (!_.isString(type)) {
console.warn('Action types are required when calling dispatcher.dispatch()');
return;
}
| javascript | {
"resource": ""
} | |
q9486 | train | function (token) {
var tokens = token;
if (!_.isArray(tokens)) {
tokens = [tokens];
}
tokens = tokens.map(function (token) {
// Allow passing stores straight and we grab the dispatcherToken | javascript | {
"resource": ""
} | |
q9487 | _ensureArray | train | function _ensureArray (model, property) {
const propertyKey = property.getKey();
let array = model.data[propertyKey];
if (!array) {
| javascript | {
"resource": ""
} |
q9488 | train | function() {
//io = socket(process.env.PORT || process.env.NODE_PORT || 3333);
io = socket(http);
io.on('connection', function(socket){
console.log('connection happened');
//Logic for handeling a new connection here.
//ie. registering a user or something similar.
... | javascript | {
"resource": ""
} | |
q9489 | configureHandlerContext | train | function configureHandlerContext(createContext, createSettings, createOptions, event, awsContext) {
// Configure the context as a standard context
let context = typeof createContext === 'function' ? createContext() :
createContext && typeof createContext === 'object' ? copy(createContext, deep) : {};
if (!con... | javascript | {
"resource": ""
} |
q9490 | succeedLambdaCallback | train | function succeedLambdaCallback(callback, response, event, context) {
return Promises.try(() => {
const handler = context && context.handler;
if (handler && handler.useLambdaProxy) {
const statusCode = response && isNotBlank(response.statusCode) ? response.statusCode : 200;
const body = (response &... | javascript | {
"resource": ""
} |
q9491 | toLambdaProxyResponse | train | function toLambdaProxyResponse(statusCode, headers, body, defaultHeaders) {
const proxyResponse = {statusCode: statusCode};
const headersWithDefaults = headers && defaultHeaders ? merge(defaultHeaders, copy(headers)) :
headers || (defaultHeaders && copy(defaultHeaders));
if (headersWithDefaults) { | javascript | {
"resource": ""
} |
q9492 | toDefaultErrorResponseBody | train | function toDefaultErrorResponseBody(error) {
const json = error && error.toJSON();
if (json) {
if (json.httpStatus) {
delete json.httpStatus; // don't really need `httpStatus` inside `body` too, since have it in response as `statusCode`
}
| javascript | {
"resource": ""
} |
q9493 | train | function(expression) {
if (this.hasClipboard()) {
var key = this._getKey();
localStorage[key] = | javascript | {
"resource": ""
} | |
q9494 | train | function(expression) {
var pastedExpression = new Expression();
var key = this._getKey();
pastedExpression.fromJson(json.parse(localStorage[key]));
var newExpression;
if (expression) {
var expressionClone = new Expression({
operator : 'and',
expressionList : [expression, pastedExpression]
... | javascript | {
"resource": ""
} | |
q9495 | getArguments | train | function getArguments() {
var port = 3000;
var path = '.';
var args = process.argv.slice(2);
while (args.length) {
var arg = args.shift();
switch (arg) {
case '-p':
port = args.shift();
| javascript | {
"resource": ""
} |
q9496 | train | function (discount, cb) {
Discount.destroy(discount.id)
.exec(function (err, destroyedDiscounts){
if (err) return cb(err);
if (!destroyedDiscounts) return cb(null, null);
| javascript | {
"resource": ""
} | |
q9497 | ShimCache | train | function ShimCache(state, name, options) {
this._callbacks = []
| javascript | {
"resource": ""
} |
q9498 | train | function(when, operation) {
return function(values, callback) {
var callbackName = when + operation;
// Call type callback.
if (callbackName in settings) {
return settings[callbackName](settings, values, function() | javascript | {
"resource": ""
} | |
q9499 | collectDeclarations | train | function collectDeclarations (filePath) {
const declarationRegexp = /(?:\$)([\w-]+)(?:[\s\n\r\t])*(?::)(?:[\s\n\r\t])*(.+)(?:[\s\n\r\t])*(?:;)/gm; | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.