Return the published categories.
187441
def get_categories(context, template='zinnia/tags/categories.html'):
    
    return {'template': template,
            'categories': Category.published.all().annotate(
                count_entries_published=Count('entries')),
            'context_category': context.get('category')}
879023
function categories() {
  return getCategories()
    .then((body) => {
      const $ = cheerio.load(body, { normalizeWhitespace: false });

      return Promise.resolve($('div.tagcloud01 ul li a').get().map(el => el.children[0].data));
    })
    .catch(err => err);
}
550080
def blog_categories(*args):
    
    posts = BlogPost.objects.published()
    categories = BlogCategory.objects.filter(blogposts__in=posts)
    return list(categories.annotate(post_count=Count("blogposts")))
524009
def topics(self):
        
        topics = self.interface.publishers.copy()
        topics.update(self.interface.subscribers)
        return topics
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
577082
def published_children(self):
        """"""
        key = self.PUB_CHILDREN_KEY % self.pk
        #children = cache.get(key, None)
        # if children is None:
        children = Page.objects.filter_published(self.get_children()).all()
        #cache.set(key, children)
        return children
283185
def get_exported_entries(self, category, name=None):
        
        for dist in self.get_distributions():
            r = dist.exports
            if category in r:
                d = r[category]
                if name is not None:
                    if name in d:
                        yield d[name]
                else:
                    for v in d.values():
                        yield v
1266693
def text_channels(self):
        """"""
        ret = [c for c in self.guild.channels
            if c.category_id == self.id
            and isinstance(c, TextChannel)]
        ret.sort(key=lambda c: (c.position, c.id))
        return ret
736468
def get_category_files_from_api(category_name):
    """"""
    import mwclient
    site = mwclient.Site('commons.wikimedia.org')
    category = site.Categories[category_name]
    return (x.page_title.encode('utf-8')
            for x in category.members(namespace=6))
237410
def category(self):
        
        if self.api and self.category_id:
            return self.api._get_category(self.category_id)
956036
def related_by_category(obj, count, collected_so_far, mods=[], only_from_same_site=True):
    
    related = []
    # top objects in given category
    if count > 0:
        from ella.core.models import Listing
        cat = obj.category
        listings = Listing.objects.get_queryset_wrapper(
            category=cat,
            content_types=[ContentType.objects.get_for_model(m) for m in mods]
        )
        for l in listings[0:count + len(related)]:
            t = l.publishable
            if t != obj and t not in collected_so_far and t not in related:
                related.append(t)
                count -= 1

            if count <= 0:
                return related
    return related
1083531
def get_entry_tags(self, categories):
        
        tags = []
        for category in categories:
            domain = category.attrib.get('domain', 'category')
            if 'tag' in domain and category.attrib.get('nicename'):
                tags.append(category.attrib.get('nicename'))
        return tags
310336
public function getPublished()
    {
        return $this->getModel()->with([
            'menus' => function ($query) {
                $query->limitDepth(1)->orderBy('order', 'asc');
            },
            'menus.permissions',
            'menus.children',
        ])->published()->get();
    }
834585
function(categories) {
			this._categoryInfos = categories.getCategoryIDs().map(function(catId) {
				return categories.getCategory(catId);
			}).sort(function(c1, c2) {
				var o1 = c1.order || 100;
				var o2 = c2.order || 100;
				if (o1 < o2) {
					return -1;
				} else if (o2 < o1) {
					return 1;
				}
				return c1.textContent.localeCompare(c2.textContent);
			});
		}
791369
def collect_publications(self):
        
        pubs = list(self.sub_publications)

        for sub_tree in self.sub_trees:
            pubs.extend(sub_tree.collect_publications())

        return pubs
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()
625178
@Override
    public List<Category> getCategories() {
        return categories == null ? (categories = new ArrayList<Category>()) : categories;
    }