List group categories for a context.

        Returns a list of group categories in a context
189722
def list_group_categories_for_context_accounts(self, account_id):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - account_id
        """ID"""
        path["account_id"] = account_id

        self.logger.debug("GET /api/v1/accounts/{account_id}/group_categories with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("GET", "/api/v1/accounts/{account_id}/group_categories".format(**path), data=data, params=params, all_pages=True)
1367382
protected function getListCategory()
    {
        $conditions = $this->query_filter;
        $conditions['category_group_id'] = $this->data_category_group['category_group_id'];
        $list = $this->category->getTree($conditions);

        $this->prepareListCategory($list);
        return $list;
    }
701386
def get_entry_categories(self, category_nodes):
        
        categories = []
        for category_node in category_nodes:
            domain = category_node.attrib.get('domain')
            if domain == 'category':
                categories.append(self.categories[category_node.text])
        return categories
954597
def entity_categories(self, entity_id):
        
        attributes = self.entity_attributes(entity_id)
        return attributes.get(ENTITY_CATEGORY, [])
440120
public function listCategory($category_group_id)
    {
        $this->setCategoryGroup($category_group_id);
        $this->actionListCategory();

        $this->setTitleListCategory();
        $this->setBreadcrumbListCategory();
        $this->setFilterListCategory();
        $this->setPagerListCategory();

        $this->setData('categories', $this->getListCategory());
        $this->setData('category_group_id', $category_group_id);

        $this->outputListCategory();
    }
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.")
537481
def list(showgroups):
    

    ecode = 0
    try:
        result = {}
        subscribed = {}
        available = {}
        unavailable = {}
        current_user_data = contexts['anchore_auth']['user_info']
        feedmeta = anchore_feeds.load_anchore_feedmeta()

        for feed in feedmeta.keys():
            if feedmeta[feed]['subscribed']:
                subscribed[feed] = {}
                subscribed[feed]['description'] = feedmeta[feed]['description']
                if showgroups:
                    subscribed[feed]['groups'] = feedmeta[feed]['groups'].keys()

            else:
                if current_user_data:
                    tier = int(current_user_data['tier'])
                else:
                    tier = 0

                if int(feedmeta[feed]['access_tier']) > tier:
                    collection = unavailable
                else:
                    collection = available

                collection[feed] = {}

                collection[feed]['description'] = feedmeta[feed]['description']
                if showgroups and collection == available:
                    collection[feed]['groups'] = feedmeta[feed]['groups'].keys()

        if available:
            result['Available'] = available
        if subscribed:
            result['Subscribed'] = subscribed
        if unavailable:
            result['Unavailable/Insufficient Access Tier'] = unavailable

        anchore_print(result, do_formatting=True)
    except Exception as err:
        anchore_print_err('operation failed')
        ecode = 1

    sys.exit(ecode)
595856
def categories(self):
        """"""
        category_dict = {}
        for ligand in self:
            if ligand.category in category_dict:
                category_dict[ligand.category].append(ligand)
            else:
                category_dict[ligand.category] = [ligand]
        return category_dict
1129018
def commdct2grouplist(gcommdct):
    """"""
    gdict = {}
    for objidd in gcommdct:
        group = objidd[0]['group']
        objname = objidd[0]['idfobj']
        if group in gdict:
            gdict[group].append(objname)
        else:
            gdict[group] = [objname, ]
    return gdict
237410
def category(self):
        
        if self.api and self.category_id:
            return self.api._get_category(self.category_id)
1097199
def get_group_names(self):
        
        if self._group_names is None:
            self._load_cached_attr("_group_names")

        if self._group_names is None:
            group_infos = self._get_group_infos()
            self._group_names = {
                self._group_type.group_name_from_info(group_info)
                for group_info in group_infos
            }
            self._cache_attr("_group_names")

        return self._group_names
357465
def groups(self):
        
        return Groups(url="%s/groups" % self.root,
                       securityHandler=self._securityHandler,
                       proxy_url=self._proxy_url,
                       proxy_port=self._proxy_port,
                       initalize=False)
1033323
def result_list(context):
    
    view = context['view']
    object_list = context['object_list']
    headers = list(result_headers(view))
    num_sorted_fields = 0
    for h in headers:
        if h['sortable'] and h['sorted']:
            num_sorted_fields += 1
    context.update({
        'result_headers': headers,
        'num_sorted_fields': num_sorted_fields,
        'results': list(results(view, object_list))})
    return context
679900
def groups(self, group_type=None, filters=None, params=None):
        
        group = self._tcex.ti.group(group_type)
        for g in self.tc_requests.groups_from_tag(group, self.name, filters=filters, params=params):
            yield g
825022
def group_plugins_into_categories(plugins):
    
    if not plugins:
        return {}
    plugins = sorted(plugins, key=lambda p: p.verbose_name)
    categories = {}

    for plugin in plugins:
        title = str(plugin.category or u"")  # enforce resolving ugettext_lazy proxies.
        if title not in categories:
            categories[title] = []
        categories[title].append(plugin)

    return categories
16307
def get_categories(self):
        
        sdb_resp = get_with_retry(self.cerberus_url + '/v1/category',
                                headers=self.HEADERS)

        throw_if_bad_response(sdb_resp)
        return sdb_resp.json()
814606
def get_classifications(subcategory_key):
    
    classifications = definition(subcategory_key)['classifications']
    return sorted(classifications, key=lambda k: k['key'])