Get a list of tags.

        :param resource: (optional) Restrict to given resource type as string.
        :param sort: (optional) Sort fields to apply as string list.
        :return: :class:`tags.Tag <tags.Tag>` list
340338
def list(self, resource=None, sort=None):
        
        schema = TagSchema()
        resp = self.service.get(self.base, params={'resource': resource, 'sort': sort})
        return self.service.decode(schema, resp, many=True)
1191262
def get_tags_of_port(self, port):
        
        return(sorted([tag for tag in self.cluster_tags
                       if port in self.cluster_tags[tag]]))
1199696
def get_collection(self, request, **resources):
        
        if self._meta.queryset is None:
            return []

        # Filter collection
        filters = self.get_filters(request, **resources)
        filters.update(self.get_default_filters(**resources))
        qs = self._meta.queryset
        for key, (value, exclude) in filters.items():
            try:
                if exclude:
                    qs = qs.exclude(**{key: value})

                else:
                    qs = qs.filter(**{key: value})
            except FieldError, e:
                logger.warning(e)

        sorting = self.get_sorting(request, **resources)
        if sorting:
            qs = qs.order_by(*sorting)

        return qs
885311
def get_resource_tag_map(self, r_type, ids):
        
        manager = self.manager.get_resource_manager(r_type)
        r_id = manager.resource_type.id
        # TODO only fetch resource with the given ids.
        return {
            r[r_id]: {t['Key']: t['Value'] for t in r.get('Tags', [])}
            for r in manager.resources() if r[r_id] in ids
        }
106117
def tags(self):
        
        tags = self.fields['tags']
        return [(t, v) for t in tags for v in tags[t]]
839106
def get_tag(self, tag):
        
        headers = {'Accept': 'text/plain'}
        j, _ = self.datacenter.request('GET', self.path + '/tags/' + tag)
        return j
248956
def get_tags(instance_id=None, keyid=None, key=None, profile=None,
             region=None):
    '''
    
    '''
    tags = []
    client = _get_conn(key=key, keyid=keyid, profile=profile, region=region)
    result = client.get_all_tags(filters={"resource-id": instance_id})
    if result:
        for tag in result:
            tags.append({tag.name: tag.value})
    else:
        log.info("No tags found for instance_id %s", instance_id)
    return tags
473428
def get_tag(tag_type)
      matches = @tags.select { |m| m.type==tag_type }
      return matches.first
    end
946401
public static List<URL> getResources(String resource) {
		final Enumeration<URL> resources;
		try {
			resources = ClassLoaderUtil.getClassLoader().getResources(resource);
		} catch (IOException e) {
			throw new IORuntimeException(e);
		}
		return CollectionUtil.newArrayList(resources);
	}
18911
def list_tags(self):
        
        from highton.models.tag import Tag
        return fields.ListField(
            name=self.ENDPOINT,
            init_class=Tag
        ).decode(
            self.element_from_string(
                self._get_request(
                    endpoint=self.ENDPOINT + '/' + str(self.id) + '/' + Tag.ENDPOINT,
                ).text
            )
        )
782536
def get_tags(artist_id, options={})
      api_response = @api_client.make_api_request(:GET, "artist/tags", {:artistId => artist_id}, options)
      @api_client.tag_digestor.list_from_xml_doc(api_response.item_xml("tags"))
    end
1182288
def get_tags(self, repo_slug=None):
        
        repo_slug = repo_slug or self.repo_slug or ''
        url = self.url('GET_TAGS', username=self.username, repo_slug=repo_slug)
        return self.dispatch('GET', url, auth=self.auth)
1330300
def get_all_client_tags(self, params=None):
        
        return self._iterate_through_pages(
            get_function=self.get_client_tags_per_page,
            resource=CLIENT_TAGS,
            **{'params': params}
        )
933741
def get_for_tag(self, tag):
        
        tag_filter = {'tag': tag}

        if isinstance(tag, six.integer_types):
            tag_filter = {'tag_id': tag}
        elif isinstance(tag, str):
            tag_filter = {'tag__slug': tag}

        return self.filter(id__in=[
            entry_tag.entry_id
            for entry_tag
            in EntryTag.objects.filter(**tag_filter)
        ])
672625
def resource_listing(cls, request) -> [(200, 'Ok', ResourceListingModel)]:
        ''''''
        apis = [api.get_swagger_fragment() for api in Api if not api.private]
        Respond(200, {
            'apiVersion': cls.api.version,
            'swaggerVersion': cls.api.swagger_version,
            'apis': apis
        })
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
978346
def list_metadata(self, resource):
        
        self.metadata_service.set_auth(self._token_metadata)
        return self.metadata_service.list(resource)