Fetch the resource groups available

@param {Function} callback
@return {ImboClient}
976305
function(callback) {
        request.get(
            this.getResourceUrl({ path: '/groups', user: null }),
            function onResourceGroupsResponse(err, res, body) {
                callback(
                    err,
                    body && body.groups,
                    body && body.search,
                    res
                );
            }
        );
        return this;
    }
984464
public function groupWhere($callback)
    {
        $origQuery = $this->query; //get original raw of query
        $this->query = ''; //clear orig part in order to get only group part
        $qb = $callback($this); //get queryBuilder from call back
        $query = $qb->query.')'; //get group part of query from queryBuilder with )
        $query = preg_replace('/AND /', 'AND (', $query, 1); //add (
        $this->query = $origQuery.$query; //make full query
    }
123205
function(params, headers, callback) {
        var url;
        url = this.client.url(false);
        return this.client.get(url, params, headers, callback);
      }
257630
function(callback) {
                var _this = this

                var initStorage = function() {
                    var obj = JSON.stringify([])
                    var _set = {}
                    _set[_this.key] = obj
                    storage.set(_set)

                    obj = JSON.parse(obj)

                    return obj
                }

                storage.get(this.key, function(items) {
                    var obj
                    if (Object.keys(items).length > 0) {
                        for (itemKey in items) {
                            obj = items[itemKey]
                            if (obj) {
                                obj = JSON.parse(obj)
                            }

                            if (obj === null || typeof obj === 'undefined') {
                                obj = initStorage()
                            } 
                            
                            if (callback) {
                                callback(obj)
                            }
                        }
                    } else {
                        obj = initStorage()
                        callback(obj)
                    }
                })
            }
1183958
function (source, callback, context) {
            var results = [];
            var i = source.length;
            while (i--) {
                results[i] = callback.call(context || source, source[i], i);
            }
            return results;
        }
325959
public List<CallbackMetadata> getCallbacks(CallbackType callbackType) {
    return callbacks == null ? null : callbacks.get(callbackType);
  }
327664
function() {
            // Get the resource's new metadata
            self.resources.get(createdResource.id, function(err, resource) {
                if (err) {
                    return callbacks.error(err);
                }

                // Check thumbnails
                var thumbnailsDone = _.chain(resource.thumbnails)
                    .filter({'status': 'pending'})
                    .isEmpty()
                    .value();
                if (thumbnailsDone) {
                    callbacks.thumbnails(resource.thumbnails);
                }

                // Check the images
                var imagesDone = _.chain(resource.images)
                    .filter({'status': 'pending'})
                    .isEmpty()
                    .value();
                if (imagesDone) {
                    callbacks.images(resource.images);
                }

                // If there are no pending processors left, we're done and can return to the caller
                if (resource.status !== 'pending') {
                    return callbacks.complete(resource);

                // Continue polling as long as there are still pending processors
                } else {
                    // Add a quarter of the polling timeout each time we check whether new updates
                    // are available. This will ensure that the interval gradually backs off.
                    pollingTimeout += Math.round(pollingTimeout / Embdr.DEFAULT_POLLING_BACKOFF_DENOMINATOR);
                    if (pollingTimeout > Embdr.MAX_POLLING_TIMEOUT) {
                        pollingTimeout = Embdr.MAX_POLLING_TIMEOUT;
                    }
                    setTimeout(poll, pollingTimeout);
                }
            });
        }
1216775
def map(self, callback):
        
        if isinstance(self._items, dict):
            return Collection(list(map(callback, self._items.values())))

        return Collection(list(map(callback, self._items)))
484464
function(groupName, resources, callback) {
        var url = this.getResourceUrl({ path: '/groups/' + groupName, user: null });
        request({
            method: 'PUT',
            uri: this.getSignedResourceUrl('PUT', url),
            json: resources,
            onComplete: function(err, res, body) {
                callback(err, body, res);
            }
        });

        return this;
    }
1155876
function (callback) {
                var result = [], boundCallback = _gpfArrayBind(callback, arguments);
                _gpfArrayForEachOwn(this, function (item, idx, array) {
                    if (boundCallback(item, idx, array)) {
                        result.push(item);
                    }
                });
                return result;
            }
445796
function (context, callback) {
            var self = this,
                options,
                offset = 0,
                limit = 0,
                items,
                parameters = context.request.urlInfo.parameter;

            flow()
                .seq("collection", function (cb) {
                    self._findCollection(context, cb, false);
                })
                .seq("query", function (cb) {
                    var query = self.$restHandler.parseQueryForResource(parameters, self);
                    if (!query.query.sort) {
                        // use default sorting
                        var configuration = context.dataSource.getConfigurationForModelClass(this.vars.collection.$modelFactory);
                        if (configuration && configuration.$.defaultSorting) {
                            query.sort(configuration.$.defaultSorting);
                        }
                    }
                    self._modifyCollectionQuery(query, cb);
                })
                .seq("page", function (cb) {

                    this.vars.collection = this.vars.collection.query(this.vars.query);
                    var pageSize = context.dataSource.$.collectionPageSize;

                    if (parameters["limit"]) {
                        limit = parseInt(parameters["limit"]);
                    }

                    if (!limit || isNaN(limit)) {
                        limit = 100;
                    }

                    if (parameters["offset"]) {
                        offset = parseInt(parameters["offset"]);
                    }

                    // calculate page
                    limit = limit > pageSize ? pageSize : limit;

                    this.vars.collection.fetch({limit: limit, offset: offset}, cb);
                })
                .exec(function (err, results) {
                    if (!err) {
                        var response = context.response;

                        // switch context of collection to RestDataSource
                        var collection = results["collection"];
                        items = results["page"].$items;
                        // call compose
                        var processor = self.$restHandler.$restDataSource.getProcessorForCollection(collection);

                        items.forEach(function (item) {
                            var id = item.identifier();
                            if (id) {
                                self._fetchAllHrefsForModel(item, context);
                            }
                        });

                        var itemArray = processor.composeCollection(results["page"], "GET", null);

                        var res = {
                            count: results["collection"].$.$itemsCount,
                            limit: limit,
                            offset: offset,
                            results: itemArray
                        };

                        response.writeHead(200, "", {
                            'Content-Type': 'application/json; charset=utf-8'
                        });

                        response.write(JSON.stringify(res), 'utf8');
                        response.end();

                        callback(null);
                    } else {
                        if (!(err instanceof HttpError)) {
                            var statusCode = 404;
                            if (err === DataSource.ERROR.NOT_FOUND) {
                                statusCode = 404;
                            }
                            err = new HttpError(err, statusCode);
                        }
                        callback(err);
                    }


                });
        }
655137
function(callback) {
        request.get(this.getStatsUrl(), function(err, res, body) {
            callback(err, body, res);
        });

        return this;
    }
897676
function(groupName, callback) {
        request.head(
            this.getResourceUrl({ path: '/groups/' + groupName, user: null }),
            get404Handler(callback)
        );
        return this;
    }
1138499
function all(callback) {
        var Model = this;
        var request = {
            find : 'find',
            model : Model
        };
        
        this.dispatch('beforeAll'); 
        this.storage.find(request, function findCallback(data) {
            if (callback) {
                callback(data);
                Model.dispatch('afterAll');
            }
        });
        
        return this;
    }
114051
function(callback) {
    async.series([
      this.downloadPackageRootObjects.bind(this),
      this.downloadPackageVersions.bind(this)
    ], function(err) {
      return callback && callback(err);
    });
  }
1016735
function (callback) {
    var self = this;

    self._request({
      path: urlJoin(_urlPrefix, 'alloweddomains')
    }, function (err, body) {
      return callback(err, body.allowedDomains);
    });
  }
612591
function getDataBasedOnCatalog(options, catalogs, models, cb) {

  async.each(catalogs,
    function(catalog, catcallback) {
      /* Next, go to APIs for each catalog */
      async.each(models,
        function(model, modelcallback) {
          pullDataFromEndp(options, catalog, model, function(err) {
            if (err) {
              logger.error(err);
            }
            modelcallback(err);
          });
        },
        function(err) {
          catcallback(err);
        });
    },
    function(err) {
      cb(err, response);
    }
  );
}