IdGenerator function for aggregate id.
@param {Function} callback The function, that will be called when this action is completed.
`function(err, newId){}`
15138
function (cmd, callback) {
    var getNewIdFn = this.eventStore.getNewId.bind(this.eventStore);
    if (this.aggregate && this.aggregate.getNewAggregateId) {
      getNewIdFn = this.aggregate.getNewAggregateId.bind(this.aggregate);
    } else if (this.getNewAggregateIdFn) {
      getNewIdFn = this.getNewAggregateIdFn.bind(this);
    }

    if (getNewIdFn.length === 2) {
      return getNewIdFn(cmd, callback);
    }

    getNewIdFn(callback);
  }
669230
function(callback) {
      var i = 0,
          keys = this.keys(),
          returned;

      for (i; i < keys.length; i++) {
        returned = callback(keys[i], this.get(keys[i]));
        if (returned === false) { return false; }
      };
    }
1240456
function (id, callback) {
    var idIsArr = Array.isArray(id);

    if (!id || (idIsArr && id.length === 0)) {
      return _handleErr('Id required for id API call', callback);
    }

    // If an array of Id's was passed, generate a comma delimited string for
    // the query string.
    if (idIsArr) {
      id = id.join();
    }

    return this._request({
      api: 'gifs',
      query: {
        ids: id
      }
    }, callback);
  }
398497
function classId(func) {
	var result = func['__id__'];
	if (result == null) {
		result = nonenum(func, '__id__', currentId++);
	}
	return result;
}
176484
function getPaymentById(id, callback) {
    var client = new this.clients.Payments();
    client.getById(id, callback);
  }
1121855
function (id, callback) {
        var todos = data.todos;

        for (var i = 0; i < todos.length; i++) {
          if (todos[i].id == id) {
            todos.splice(i, 1);
            break;
          }
        }

        flush();
        callback.call(undefined, data.todos);
      }
1095089
function (callback) {
    IdentityCounter.findOne({
      model: settings.model,
      field: settings.field
    }, function (err, counter) {
      if (err) return callback(err);
      callback(null, counter === null ? settings.startAt : counter.count + settings.incrementBy);
    });
  }
398548
function AggregateModel (id, modelInitValues) {
  if (!id || !_.isString(id)) {
    var err = new Error('No id injected!');
    debug(err);
    throw err;
  }

  this.id = id;

  if (modelInitValues instanceof AggregateModel) {
    this.attributes = modelInitValues.toJSON();
  } else {
    this.attributes = _.cloneDeep(modelInitValues || {});
  }

  this.attributes.id = this.id;
  this.attributes._destroyed = this.attributes._destroyed || false;
  this.attributes._revisions = this.attributes._revisions || {};
  this.attributes._revision = this.attributes._revision || 0;

  this.uncommittedEvents = [];
}
901246
function(callback, guid) {
		// If the guid has not been supplied then create a new one.
		guid = guid || '_hellojs_' + parseInt(Math.random() * 1e12, 10).toString(36);

		// Define the callback function
		window[guid] = function() {
			// Trigger the callback
			try {
				if (callback.apply(this, arguments)) {
					delete window[guid];
				}
			}
			catch (e) {
				console.error(e);
			}
		};

		return guid;
	}
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)
  }
790195
function describe(id, callback) {
    if (id == undefined)
      return callback(new TypeError("'id' can't be null or undefined"))

    var mediaObject = objects[id];
    if (mediaObject) return callback(null, mediaObject);

    var params = {
      object: id
    };

    function callback2(error, result) {
      if (error) return callback(error);

      var mediaObject = mediaObjectCreator.createInmediate(result);

      return callback(null, registerObject(mediaObject, id));
    }

    encode('describe', params, callback2);
  }
482449
function(object, events, callback) {
      var listeners = this._listeners || (this._listeners = {});
      var id = object._listenerId || (object._listenerId = _.uniqueId('l'));
      listeners[id] = object;
      object.on(events, callback || this, this);
      return this;
    }
583686
function spawnNodeWithId (factory, callback) {
  waterfall([(cb) => factory.spawnNode(cb), identify], callback)
}
977918
function addCallback (t, data) {
  var result = data.result || data.error;
  cbid = data.id;
  if (t.callbacks[cbid]) {
    if (data.result) {
      t.callbacks[cbid](result);
    } else {
      t.callbacks[cbid](result, 'error');
    }
  }
}
1304909
function generateAggregate (aggregateOp, defaultColumnName = undefined) {
  let funcName = `get${_.upperFirst(aggregateOp)}`

  /**
   * Do not re-add the method if exists
   */
  if (KnexQueryBuilder.prototype[funcName]) {
    return
  }

  KnexQueryBuilder.prototype[funcName] = async function (columnName = defaultColumnName) {
    if (!columnName) {
      throw new Error(`'${funcName}' requires a column name.`)
    }

    const wrapper = new this.constructor(this.client)
    const query = wrapper.from(this.as('__lucid'))

    /**
     * Copy events from the original query
     */
    query._events = this._events

    /**
     * Executing query chain
     */
    const results = await query[aggregateOp](`${columnName} as __lucid_aggregate`)

    return results[0].__lucid_aggregate
  }
}
881340
function (evt, callback) {
    var self = this;

    this.executeDenormFnForEach(evt, function (err, res) {
      if (err) {
        debug(err);
        return callback(err);
      }

      async.each(res, function (item, callback) {
        if (item.id) {
          return callback(null);
        }
        self.collection.getNewId(function (err, newId) {
          if (err) {
            return callback(err);
          }
          item.id = newId;
          callback(null);
        });
      }, function (err) {
        if (err) {
          debug(err);
          return callback(err);
        }

        async.map(res, function (item, callback) {
          self.loadViewModel(item.id, function (err, vm) {
            if (err) {
              return callback(err);
            }

            self.handleOne(vm, evt, item, function (err, notification) {
              if (err) {
                return callback(err);
              }

              callback(null, notification);
            });
          });
        }, function (err, notis) {
          if (err) {
            debug(err);
            return callback(err);
          }

          callback(null, notis);
        });
      });
    });
  }
989682
function each(collection, callback) {
        if (!collection) {
            return;
        }

        for (var i = 0, l = collection.length; i < l; i += 1) {
            callback(collection[i]);
        }
    }