Returns the tag cloud for a site or a site's subscriber.
552637
def getcloud(site, feed_id=None):
	

	cloudict = fjcache.cache_get(site.id, 'tagclouds')
	if not cloudict:
		cloudict = cloudata(site)
		fjcache.cache_set(site, 'tagclouds', cloudict)

	# A subscriber's tag cloud has been requested.
	if feed_id:
		feed_id = int(feed_id)
		if feed_id in cloudict:
			return cloudict[feed_id]
		return []
	# The site tagcloud has been requested.
	return cloudict[0]
909792
def tag(self, tag):
        
        url = '%s/tags/%s' % (self, tag)
        response = self.http.get(url, auth=self.auth)
        response.raise_for_status()
        return response.json()
275460
def filter_host_by_tag(tpl):
    

    def inner_filter(items):
        """Inner filter for host. Accept if tag in host.tags"""
        host = items["host"]
        if host is None:
            return False
        return tpl in [t.strip() for t in host.tags]

    return inner_filter
929711
def get_tag_json(self, namespace, repository, tag):
        """"""
        return self._http_call(self.TAGS + '/' + tag + '/json', get,
                               namespace=namespace, repository=repository)
211622
def get_registered(self):
        """"""

        doc = self._request(self.ws_prefix + ".getInfo", True)

        return _extract(doc, "registered")
256169
def create_tag(self, name, description=None, servers=[]):
        
        servers = [str(server) for server in servers]
        body = {'tag': Tag(name, description, servers).to_dict()}
        res = self.request('POST', '/tag', body)

        return Tag(cloud_manager=self, **res['tag'])
818553
def calculate_tag_cloud(num = 5)
      range = 0

      tags = active_tags.map { |tag, posts|
        [tag.to_s, range < (size = posts.size) ? range = size : size]
      }

      range = 1..range

      tags.sort!.map! { |tag, size| [tag, range.quantile(size, num)] }
    end
126551
public function getPublicTagsList()
    {
        $config = SiteConfig::current_site_config();
        //Filter out global excluded tags and non configured Organisations
        $pub_tags = PublicTag::get()->filter(['HailID:not' => json_decode($config->HailExcludePublicTagsIDs), 'HailOrgID' => json_decode($config->HailOrgsIDs)]);

        return $pub_tags->sort(['HailOrgName ASC', 'Name ASC'])->map('HailID', 'FullName')->toArray();
    }
322753
def get_posts_tags(subscribers, object_list, feed, tag_name):
	''''''

	tagd = dict()
	user_obj = None
	tag_obj = None
	tags = models.Tag.objects.extra(
		select=dict(post_id='{0}.{1}'.format(
			*it.imap( connection.ops.quote_name,
				('feedjack_post_tags', 'post_id') ) )),
		tables=['feedjack_post_tags'],
		where=[
		'{0}.{1}={2}.{3}'.format(*it.imap( connection.ops.quote_name,
			('feedjack_tag', 'id', 'feedjack_post_tags', 'tag_id') )),
		'{0}.{1} IN ({2})'.format(
			connection.ops.quote_name('feedjack_post_tags'),
			connection.ops.quote_name('post_id'),
			', '.join([str(post.id) for post in object_list]) ) ] )

	for tag in tags:
		if tag.post_id not in tagd: tagd[tag.post_id] = list()
		tagd[tag.post_id].append(tag)
		if tag_name and tag.name == tag_name: tag_obj = tag

	subd = dict()
	for sub in subscribers: subd[sub.feed.id] = sub
	for post in object_list:
		if post.id in tagd: post.qtags = tagd[post.id]
		else: post.qtags = list()
		post.subscriber = subd[post.feed.id]
		if feed == post.feed: user_obj = post.subscriber

	return user_obj, tag_obj
255083
def pubsub(domain)
      host = @vhosts.values.find {|host| host.pubsub?(domain) }
      host.pubsubs[domain.to_s] if host
    end
1248331
def get_tags(self):
        
        j, _ = self.datacenter.request('GET', self.path + '/tags')
        return j
1278967
def get_tag(self, name):
        """"""
        res = self.get_request('/tag/' + name)
        return Tag(cloud_manager=self, **res['tag'])
225159
def query_tags(order=None, orderby=None, limit=None):
    
    from taggit.models import Tag, TaggedItem    # feature is still optional

    # Get queryset filters for published entries
    EntryModel = get_entry_model()
    ct = ContentType.objects.get_for_model(EntryModel)  # take advantage of local caching.

    entry_filter = {
        'status': EntryModel.PUBLISHED
    }
    if appsettings.FLUENT_BLOGS_FILTER_SITE_ID:
        entry_filter['parent_site'] = settings.SITE_ID

    entry_qs = EntryModel.objects.filter(**entry_filter).values_list('pk')

    # get tags
    queryset = Tag.objects.filter(
        taggit_taggeditem_items__content_type=ct,
        taggit_taggeditem_items__object_id__in=entry_qs
    ).annotate(
        count=Count('taggit_taggeditem_items')
    )

    # Ordering
    if orderby:
        queryset = queryset.order_by(*_get_order_by(order, orderby, TAG_ORDER_BY_FIELDS))
    else:
        queryset = queryset.order_by('-count')

    # Limit
    if limit:
        queryset = queryset[:limit]

    return queryset
1184632
def subdomain(self, hostname):
        
        hostname = hostname.split(":")[0]
        for domain in getDomainNames(self.siteStore):
            if hostname.endswith("." + domain):
                username = hostname[:-len(domain) - 1]
                if username != "www":
                    return username, domain
        return None
1273141
def subdomains(self, value=None):
        
        if value is not None:
            return URL._mutate(self, host='.'.join(value))
        return self.host().split('.')
157637
def __get_tags(vm_):
    '''
    
    '''
    t = config.get_cloud_config_value(
        'tags', vm_, __opts__,
        default='[]', search_global=False)
    # Consider warning the user that the tags in the cloud profile
    # could not be interpreted, bad formatting?
    try:
        tags = literal_eval(t)
    except Exception:  # pylint: disable=W0703
        tags = None
    if not tags or not isinstance(tags, list):
        tags = None
    return tags
461308
def domain_search(auth=None, **kwargs):
    '''
    
    '''
    cloud = get_operator_cloud(auth)
    kwargs = _clean_kwargs(**kwargs)
    return cloud.search_domains(**kwargs)