collect all group-by domain values
425285
function collect(cells) {
    var key, i, t, v;
    for (key in cells) {
      t = cells[key].tuple;
      for (i=0; i<n; ++i) {
        vals[i][(v = t[dims[i]])] = v;
      }
    }
  }
1155629
def get_ngroups(self, field=None):
        '''
        
        '''
        field = field if field else self._determine_group_field(field)
        if 'ngroups' in self.data['grouped'][field]:
            return self.data['grouped'][field]['ngroups']
        raise ValueError("ngroups not found in response. specify group.ngroups in the query.")
889363
def collect_by_type(self, typ):
        '''
        '''
        nodes = []
        if isinstance(self, typ):
            nodes.append(self)
        for c in self:
            nodes.extend(c.collect_by_type(typ))
        return nodes
387954
def each_indexed_object(collection, index_name, **where):
    """"""
    index = _db[collection].indexes[index_name]
    for id in index.value_map.get(indexed_value(index, where), []):
        yield get_object(collection, id)
104271
def get_domain(self, value):
        
        return [k for k, v in self.all if v == value]
979678
def domain_list(gandi):
    """"""
    domains = gandi.dns.list()
    for domain in domains:
        gandi.echo(domain['fqdn'])

    return domains
64015
def filter(self, table, groups, filter_string):
        """"""
        query = filter_string.lower()
        return [group for group in groups
                if query in group.name.lower()]
444187
def values(self):
        
        separate_values = [domain.values for domain in self._domains]
        return np.concatenate([
            join_struct_arrays(list(map(np.array, value))) 
            for value in product(*separate_values)
        ])
925456
def each_object_id(collection):
    """"""
    c_path = collection_path(collection)
    paths = glob('%s/*.%s' % (c_path, _ext))
    for path in paths:
        match = regex.match(r'.+/(.+)\.%s$' % _ext, path)
        yield match.groups()[0]
1064387
def _all(self, query):
        """"""
        if query.count() > 0:
            results = query.all()
            for result in results:
                if result.has_expired(self._expirations):
                    raise NotFoundError
            return results
        else:
            raise NotFoundError
432588
function getDomain(domain, callback) {
    getAll(function onGetAll(err, domains) {
      if (err) {
        return callback(err);
      }

      callback(null, domains.results.filter(function onGetDomain(domain_obj) {
        return domain_obj.domain == domain;
      })[0]);
    });
  }
1030171
def get_group(self, t, i):
        """"""

        try:
            value = []
            if t in _DIGIT and t != '0':
                value.append(t)
                t = next(i)
                if t in _DIGIT:
                    value.append(t)
                else:
                    i.rewind(1)
        except StopIteration:
            pass
        return ''.join(value) if value else None
712621
def group_by_source(self):
        """"""
        from collections import defaultdict
        docs = defaultdict(list)

        for k, v in self.items():
            if 'source' in v:
                docs[v.source].append(dict(v.items()))

        return docs
592480
function collectProperties(groups, properties) { 
  var collection = {};
  for (var key in groups) {
    if (Array.isArray(groups[key])) {
      collection[key] = groups[key].reduce(function(coll, item) {
        properties.forEach(function(prop) { 
          if (!coll[prop]) coll[prop] = [];
          coll[prop] = coll[prop].concat(propertyAt(item,prop));
        })
        return coll;
      }, {})
    } else {
      collection[key] = collectProperties(groups[key], properties);
    }
  }
  return collection;
}
735718
function groupByName(attrs) {
            const attributes = new Map()
            for (const node of attrs) {
                const name = node.key
                const list =
                    attributes.get(name) ||
                    (() => {
                        const a = []
                        attributes.set(name, a)
                        return a
                    })()
                list.push(node)
            }
            return attributes
        }
1089894
def query_domain(self, domain, typenames, domainquerytype='list', count=False):
        

        objects = self._get_repo_filter(Layer.objects)

        if domainquerytype == 'range':
            return [tuple(objects.aggregate(Min(domain), Max(domain)).values())]
        else:
            if count:
                return [(d[domain], d['%s__count' % domain])
                        for d in objects.values(domain).annotate(Count(domain))]
            else:
                return objects.values_list(domain).distinct()
439249
def list_domains(self):
        """"""
        domains = []
        for cookie in iter(self):
            if cookie.domain not in domains:
                domains.append(cookie.domain)
        return domains