Returns a {LightCollection} of {Light}s tagged with `tag`
 @param tag [String] Tag
 @return [LightCollection]
430602
def with_tag(tag)
      if context.tags.include?(tag)
        self.class.new(context: context, tag: tag)
      else
        raise TagNotFound.new("No such tag '#{tag}'")
      end
    end
866827
public List<MarcField> getFields(String tag) {
        return marcFields.stream().filter(marcField -> marcField.getTag().equals(tag))
                .collect(Collectors.toList());
    }
415287
def find_by_tag(self, tag, params={}, **options): 
        
        path = "/tags/%s/tasks" % (tag)
        return self.client.get_collection(path, params, **options)
611235
def get_nodes_with_tag(tag, environment=None, include_guests=False):
    """"""
    nodes = get_nodes(environment)
    nodes_mapping = dict((n['name'], n) for n in nodes)
    for n in nodes:
        if tag in n.get('tags', []):
            # Remove from node mapping so it doesn't get added twice by
            # guest walking below
            try:
                del nodes_mapping[n['fqdn']]
            except KeyError:
                pass
            yield n
            # Walk guest if it is a host
            if include_guests and n.get('virtualization', {}).get('role') == 'host':
                for guest in n['virtualization'].get('guests', []):
                    try:
                        yield nodes_mapping[guest['fqdn']]
                    except KeyError:
                        # we ignore guests which are not in the same
                        # chef environments than their hosts for now
                        pass
872553
def tags=(tags_array)
      as_strings = tags_array.collect { |tag| tag.to_s }
      self.service.setTags(as_strings.join(','))
    end
245793
def tag(*tags)
      attribute "tags" do |existing_tags|
        existing_tags ||= []
        tags.each do |tag|
          if !existing_tags.include?(tag.to_s)
            existing_tags << tag.to_s
          end
        end
        existing_tags
      end
    end
1058991
public static Map<String, String> tags(Tags tags) {
        return tags.stream()
                .map(WavefrontStrings::createTagEntry)
                .flatMap(opt -> opt.map(Stream::of).orElseGet(Stream::empty))
                .map(WavefrontStrings::maybeTruncateTagEntry)
                .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
    }
1217748
def image_by_tag(self, tag):
        
        if not tag:
            return None

        return next((image for image in self.images() if tag
                     in image['RepoTags']), None)
431793
def tag_list=(names)
      self.tags = names.split(",").map do |n|
        SimpleTags::Tag.where(name: n.strip).first_or_create!
      end
    end
995430
def get_tag(self, tagtype):
        ''' '''
        for tag in self.__tags:
            if tag.tagtype == tagtype:
                return tag
        return None
160955
def get_tag_hash(self, tag_name):
        
        tag_object = get_single_item_from_sequence(
            sequence=self._github_repository.tags(),
            condition=lambda tag: tag.name == tag_name,
            no_item_error_message='No tag "{}" exist'.format(tag_name),
            too_many_item_error_message='Too many tags "{}" found'.format(tag_name),
        )

        return tag_object.commit.sha
566841
def description(tag):
        
        tag_object = Tag(tag)
        results = []
        results.extend(tag_object.descriptions)
        subtags = tag_object.subtags
        for subtag in subtags:
            results += subtag.description

        return results
281077
function getTag(entry, tagName) {
  var parsed = entry.parsed;
  return _.find(parsed.tags, ['title', tagName]) || null;
}
1098547
def do_get_pages_with_tag(parser, token):
    
    bits = token.split_contents()
    if 4 != len(bits):
        raise TemplateSyntaxError('%r expects 2 arguments' % bits[0])
    if bits[-2] != 'as':
        raise TemplateSyntaxError(
            '%r expects "as" as the second last argument' % bits[0])
    varname = bits[-1]
    tag = parser.compile_filter(bits[1])
    varname = bits[-1]
    return GetPagesWithTagNode(tag, varname)
133241
def tags(*tags)
      if tags.size == 0
        attribute("tags")
      else
        tags = tags[0] if tags.size == 1 && tags[0].kind_of?(Array)
        attribute("tags", tags.map { |tag| tag.to_s })
      end
    end
356778
def get_servers_by_tag(tags)
      # Take tags and collapse it,
      # Default case, tag is AND
      if @match_all
        t = tags.join("&tag=")
        filter = "tag=#{t}"
        servers = Connection.instances(filter)
      else
        t = tags.join(",")
        filter = "tag=#{t}"
        servers = Connection.instances(filter)
      end

      if servers.nil?
        if @ignore_errors
          Log.warn "[#{Chimp.get_job_uuid}] Tag query returned no results: #{tags.join(" ")}"
        else
          raise "[#{Chimp.get_job_uuid}] Tag query returned no results: #{tags.join(" ")}\n"
        end
      elsif servers.empty?
        if @ignore_errors
          Log.warn "[#{Chimp.get_job_uuid}] Tag query returned no results: #{tags.join(" ")}"
        else
          raise "[#{Chimp.get_job_uuid}] Tag query returned no results: #{tags.join(" ")}\n"
        end
      end

      servers = verify_tagged_instances(servers,tags)

      return(servers)
    end
735473
def tag(self, *tags):
        
        if not all(isinstance(tag, collections.Hashable) for tag in tags):
            raise TypeError('Tags must be hashable')
        self.tags.update(tags)
        return self