Store a new ambush function. Validates id doesn't exist already, etc.

@param {Ambush} object Ambush function data.
@returns {void} Nothing.
2641
function add(object) {
	if (!_isValidAmbush(object)) {
		return false;
	}

	object.description = _cleanDescription(object.description);

	if (!_belongToAStoredAmbush(object.id)) {
		const newObject = Object.assign({}, object);
		goblin.ambush.push(newObject);
		goblin.ambushEmitter.emit('change', { type: 'add', value: newObject });
	} else {
		logger('AMBUSH_ADD_ERROR');
	}
}
1273774
function() {
			var options, name, src, copy, copyIsArray, clone,
				target = arguments[0] || {},
				i = 1,
				length = arguments.length;


			// Handle case when target is a string or something (possible in deep copy)
			if (typeof target !== 'object' && typeof target !== 'function') {
				target = {};
			}

			for ( ; i < length; i++ ) {
				// Only deal with non-null/undefined values
				if ( (options = arguments[ i ]) !== null ) {
					// Extend the base object
					for ( name in options ) {
						src = target[ name ];
						copy = options[ name ];

						// Prevent never-ending loop
						if ( target === copy ) {
							continue;
						}

						// Recurse if we're merging plain objects or arrays
						if ( copy && ( typeof copy === 'object' || (copyIsArray = Array.isArray(copy)) ) ) {
							if ( copyIsArray ) {
								copyIsArray = false;
								clone = src && Array.isArray(src) ? src : [];

							} else {
								clone = src && typeof src === 'object' ? src : {};
							}

							// Never move original objects, clone them
							target[ name ] = this.deepMerge(clone, copy );

						// Don't bring in undefined values
						} else if ( copy !== undefined ) {
							target[ name ] = copy;
						}
					}
				}
			}

			// Return the modified object
			return target;
		}
435465
@Override
    public void store(T key, INDArray object) {
        INDArray toStore;
        if (useInplaceCompression) {
            compressor.compressi(object);
            toStore = object;
        } else {
            toStore = compressor.compress(object);
        }

        if (emulateIsAbsent)
            lock.writeLock().lock();

        compressedEntries.put(key, toStore);

        if (emulateIsAbsent)
            lock.writeLock().unlock();
    }
488582
function(fn) {
        // Save off the existing spy method as __functionName
        var newName = '__' + fn;
        self[newName] = self[fn];

        // This is the actual function that will be called when,
        // for example, calledWith() is invoked
        return function() {
          var func = self[newName];
          
          // If this thing is a function, invoke it with all arguments;
          // otherwise, just grab the value of the property.
          var val = typeof func === 'function' ? func.apply(condition, arguments) : func;

          // Negate and return
          return !val;
        };
      }
531984
function (data_id) {
		if (mockIndexedDBTestFlags.canClear === true) {
			mockIndexedDB_storeClearTimer = setTimeout(function () {
				mockIndexedDBStoreTransaction.callSuccessHandler();
				mockIndexedDB_clearSuccess = true;
			}, 20);
		}
		else {
			mockIndexedDB_storeClearTimer = setTimeout(function () {
				mockIndexedDBStoreTransaction.callErrorHandler();
				mockIndexedDB_clearFail = true;
			}, 20);
		}

		return mockIndexedDBStoreTransaction;
	}
1025068
function wrapRegistrationFunction(object, property, callbackArg) {
        if (typeof object[property] !== "function") {
            console.error("(long-stack-traces) Object", object, "does not contain function", property);
            return;
        }
        if (!has.call(object, property)) {
            console.warn("(long-stack-traces) Object", object, "does not directly contain function", property);
        }

        // TODO: better source position detection
        var sourcePosition = (object.constructor.name || Object.prototype.toString.call(object)) + "." + property;

        // capture the original registration function
        var fn = object[property];
        // overwrite it with a wrapped registration function that modifies the supplied callback argument
        object[property] = function() {
            // replace the callback argument with a wrapped version that captured the current stack trace
            arguments[callbackArg] = makeWrappedCallback(arguments[callbackArg], sourcePosition);
            // call the original registration function with the modified arguments
            return fn.apply(this, arguments);
        }

        // check that the registration function was indeed overwritten
        if (object[property] === fn)
            console.warn("(long-stack-traces) Couldn't replace ", property, "on", object);
    }
217396
function injectAdditionalFunctions (funcs, additionalFunctions) {
  // Nothing to do if no additional function is given.
  if (no(additionalFunctions)) return

  /**
   * Validate and insert an additional function.
   */

  function injectAdditionalFunction (key) {
    var isAFunction = typeof additionalFunctions[key] === 'function'

    if (isAFunction) funcs[key] = additionalFunctions[key]
  }

  Object.keys(additionalFunctions)
    .forEach(injectAdditionalFunction)
}
654928
protected void storeReference(Object obj) {
        refMap.put(new IdentityWrapper(obj), Short.valueOf(refId++));
    }
712489
function Store(name, id, keys, optionalEngine) {
  this.id = id;
  this.name = name;
  this.keys = keys || {};
  this.engine = optionalEngine || defaultEngine;
}
66915
function onEntityStorageFailure( serverResponse ) {
		var self = this;

		self.logInterface.error( self.logPrefix + "Unable to store entity on the server.",
			serverResponse );
		self.logInterface.error( serverResponse );
		self.scope.$emit( "absyncError", serverResponse );

		if( self.throwFailures ) {
			throw serverResponse;
		}
	}
1213628
function checkForIdAndData(object, callback) {
    var id = object[options.idProperty]
      , foundObject
    if (id === undefined || id === null) {
      return callback(new Error('Object has no \''
        + options.idProperty + '\' property'))
    }

    foundObject = findById(id)

    if (foundObject === null) {
      return callback(new Error('No object found with \''
        + options.idProperty + '\' = \'' + id + '\''))
    }

    return callback(null, foundObject)
  }
821804
function (data_id) {
		if (mockIndexedDBTestFlags.canDelete === true) {
			mockIndexedDB_storeDeleteTimer = setTimeout(function () {
				mockIndexedDBStoreTransaction.callSuccessHandler();
				mockIndexedDB_deleteSuccess = true;
			}, 20);
		}
		else {
			mockIndexedDB_storeDeleteTimer = setTimeout(function () {
				mockIndexedDBStoreTransaction.callErrorHandler();
				mockIndexedDB_deleteFail = true;
			}, 20);
		}

		return mockIndexedDBStoreTransaction;
	}
630421
function(obj, functName, attr) {
    if (d4.isNotFunction(attr)) {
      var prop = '$' + functName;
      readOnlyProp(obj, prop, functName, attr);
    }
  }
320772
function() {
    var options, name, src, copy, copyIsArray, clone,
      target = arguments[0] || {},
      i = 1,
      length = arguments.length,
      deep = false;

    // Handle a deep copy situation
    if ( typeof target === 'boolean' ) {
      deep = target;
      target = arguments[1] || {};
      // skip the boolean and the target
      i = 2;
    }

    // Handle case when target is a string or something (possible in deep copy)
    if ( typeof target !== 'object' && !is.fn(target) ) {
      target = {};
    }

    // extend jQuery itself if only one argument is passed
    if ( length === i ) {
      target = this;
      --i;
    }

    for ( ; i < length; i++ ) {
      // Only deal with non-null/undefined values
      if ( (options = arguments[ i ]) != null ) {
        // Extend the base object
        for ( name in options ) {
          src = target[ name ];
          copy = options[ name ];

          // Prevent never-ending loop
          if ( target === copy ) {
            continue;
          }

          // Recurse if we're merging plain objects or arrays
          if ( deep && copy && ( is.plainObject(copy) || (copyIsArray = is.array(copy)) ) ) {
            if ( copyIsArray ) {
              copyIsArray = false;
              clone = src && is.array(src) ? src : [];

            } else {
              clone = src && is.plainObject(src) ? src : {};
            }

            // Never move original objects, clone them
            target[ name ] = util.extend( deep, clone, copy );

          // Don't bring in undefined values
          } else if ( copy !== undefined ) {
            target[ name ] = copy;
          }
        }
      }
    }

    // Return the modified object
    return target;
  }
215501
function(api, id, obj) {
  if(!api) {
    throw new Error('WebStorage not available.');
  }

  var rval;
  if(obj === null) {
    rval = api.removeItem(id);
  } else {
    // json-encode and base64-encode object
    obj = util.encode64(JSON.stringify(obj));
    rval = api.setItem(id, obj);
  }

  // handle potential flash error
  if(typeof(rval) !== 'undefined' && rval.rval !== true) {
    var error = new Error(rval.error.message);
    error.id = rval.error.id;
    error.name = rval.error.name;
    throw error;
  }
}
158417
function ReplayHandler (disp, store, def, options) {
  this.dispatcher = disp;

  this.store = store;

  def = def || {};

  this.definition = {
    correlationId: 'correlationId', // optional
    id: 'id',                       // optional
    name: 'name',                   // optional
//      aggregateId: 'aggregate.id',    // optional
//      context: 'context.name',        // optional
//      aggregate: 'aggregate.name',    // optional
    payload: 'payload'              // optional
//      revision: 'revision'            // optional
//      version: 'version',             // optional
//      meta: 'meta'                    // optional, if defined theses values will be copied to the notification (can be used to transport information like userId, etc..)
  };

  this.definition = _.defaults(def, this.definition);

  options = options || {};

  this.options = options;
}
700046
public void savePersistentObject(PersistentObject object) {
        final String type = object.getClass().getSimpleName();
        LOG.trace("Trying to create a new " + type);
        dao.saveOrUpdate(object);
        LOG.info("Created the " + type + " with id " + object.getId());
    }