/*
cursor.all(callback)

Retrieves all items from the cursor, and passes an array of the items
to the callback function.

- callback : function(err, items)
Required
768248
function(callback)
    {
        var self = this, items = [];
        
        var append = function(err, item) {
            if (err)
            {
                return callback(err);
            }
            if (item)
            {
                items.push(item);
                self.next(append);
            }
            else
            {
                callback(null, items);
            }
        };
        
        this.next(append);
    }
576744
function _each(array, func) {
        for (var i = 0, l = array.length; i < l; i++) {
            func(array[i]);
        }
    }
246751
function _each( object, callback, thisObj ) {

		if ( !object ) {
			return Promise.resolve();
		}

		var results;
		var fns = [];

		if ( Object.prototype.toString.call( object ) === '[object Array]' ) {

			results = [];

			var length = object.length;
			for ( var idx = 0; idx < length; idx ++ ) {
				var value = callback.call( thisObj || this, object[ idx ], idx );
				if ( value ) {
					fns.push( value );
					if ( value instanceof Promise ) {
						value.then( function( key, value ) {
							results[ idx ] = value;
						}.bind( this, key ));
					} else {
						results[ idx ] = value;
					}
				}
			}

		} else {

			results = {};

			for ( var key in object ) {
				if ( object.hasOwnProperty( key ) ) {
					var value = callback.call( thisObj || this, object[ key ], key );
					if ( value ) {
						fns.push( value );
						if ( value instanceof Promise ) {
							value.then( function( key, value ) {
								results[ key ] = value;
							}.bind( this, key ));
						} else {
							results[ key ] = value;
						}
					}
				}
			}

		}

		return Promise.all( fns ).then( function() {
			return results;
		});

	}
138487
def _fetch_all_as_dict(self, cursor):
        
        desc = cursor.description
        return [
            dict(zip([col[0] for col in desc], row))
            for row in cursor.fetchall()
        ]
393774
function(){
    /** @cut */   var result = [];
    /** @cut */   var cursor = this;
    /** @cut */
    /** @cut */   while (cursor = cursor.handler)
    /** @cut */     result.push([cursor.callbacks, cursor.context]);
    /** @cut */
    /** @cut */   return result;
    /** @cut */ }
179875
function each(collection, callback) {
        if (utils.isNode(collection) || collection === window || collection === document) {
            collection = [collection];
        }
        if (!utils.isArrayLike(collection) && !utils.isObject(collection)) {
            collection = [collection];
        }
        if (utils.size(collection) == 0) {
            return;
        }

        if (utils.isArrayLike(collection) && !utils.isObject(collection)) {
            var l = collection.length,
                i = 0;
            for (; i < l; i++) {
                if (callback.call(collection[i], collection[i], i, collection) === false) {
                    break;
                }
            }
        } else if (utils.isObject(collection)) {
            for (var key in collection) {
                if (utils.has(collection, key)) {
                    if (callback.call(collection[key], collection[key], key, collection) === false) {
                        break;
                    }
                }
            }
        }
    }
774420
function(arr, callback) {

        var result = arr.map(callback);

        return result.filter(function(item) {
            return item !== undefined && item !== null;
        });
    }
62545
def select(self, cmd, *args, **kwargs):
        
        self.cursor.execute(cmd, *args, **kwargs)
        return self.cursor.fetchall()
201266
function all(options, cb) {
  var q
    , page = Number(options.page) || 1
    , limit = Number(options.limit) || conf.objects_by_page
    , offset = (page - 1) * limit;

  count(function(err, count) {
    if(err) { return cb(err); }

    q = select('LEFT JOIN');
    q += ' LIMIT ' + limit + ' OFFSET ' + offset;

    db.getClient(function(err, client, done) {
      client.query(q, function(err, r) {
        if(err) {
          cb(err);
          done(err);
        } else {
          cb(null, {
            rows: r.rows,
            count: count,
            limit: limit,
            offset: offset,
            page: page
          });
          done();
        }
      });
    });
  });
}
807368
function each(object, callback) {
		if (!object) { return true; }
		if (object.forEach) { return object.forEach(callback); }
		if (object instanceof Array) {
			var	length	= array ? array.length : 0;
			for(var index = 0; index < length; index++) {
				callback(array[index], index);
			}
		}else{
			for(var key in object) {
				if (!object.hasOwnProperty(key)) { continue; }
				callback(object[key], key);
			}
		}
		return false;
	}
1294405
function servicesAll (callback) {
    // callback must be a function
    assert(typeof callback === 'function', 'servicesAll callback must be function')
    // call callback for each service
    return Promise.all(_.map(_.keys(getServices()), name => {
        // get service
        var service = getService(name)
        // call callback and return promise
        return callback(service)
    }))
}
346780
function getAllStoreNames(db) {
    return new Promise$1(function (resolve, reject) {
        db.transaction(function (t) {
            t.executeSql('SELECT name FROM sqlite_master ' + "WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'", [], function (t, results) {
                var storeNames = [];

                for (var i = 0; i < results.rows.length; i++) {
                    storeNames.push(results.rows.item(i).name);
                }

                resolve({
                    db: db,
                    storeNames: storeNames
                });
            }, function (t, error) {
                reject(error);
            });
        }, function (sqlError) {
            reject(sqlError);
        });
    });
}
1369757
function _get_all_items(){
	var ret_filters = [];
	var complete_filters = bbop.core.get_keys(anchor.current_data);
	for( var cfi = 0; cfi < complete_filters.length; cfi++ ){
	    var test_filter = complete_filters[cfi];
	    if( test_filter != '_nil_' ){
		ret_filters.push(test_filter);
	    }
	}
	return ret_filters;
    }
697906
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;
          if (cursor) {
            res.push(cursor.value);
            cursor.continue();
          } else {
            resolve(res);
          }
        };
    });
  });
}
704290
def all(klass, account, tailored_audience_id, **kwargs):
        """"""

        resource = klass.RESOURCE_COLLECTION.format(
            account_id=account.id,
            tailored_audience_id=tailored_audience_id)
        request = Request(account.client, 'get', resource, params=kwargs)

        return Cursor(klass, request, init_with=[account])
931051
def _updateall(self, query, vars, returning=False):
        
        cursor = self.get_db().cursor()
        self._log(cursor, query, vars)
        cursor.execute(query, vars)
        self.get_db().commit()
        return cursor.fetchall() if returning else None
1056242
function every(object, callback) {
		if (!object) { return true; }
		if (object.every) { return object.every(callback); }
		if (object instanceof Array) {
			var	length	= array ? array.length : 0;
			for(var index = 0; index < length; index++) {
				if (!callback(array[index], index)) { return false; }
			}
		}else{
			for(var key in object) {
				if (!object.hasOwnProperty(key)) { continue; }
				if (!callback(object[key], key)) { return false; }
			}
		}
		return true;
	}