Reduce the list of tags, to only those specified in the argument set.
@param tag_names The tag names to retain.
@return A new instance of tags, which contains only tags mentioned in the argument set.
966354
public Tags filter(Set<String> tag_names) {
        return Tags.valueOf(tags_.entrySet().stream()
                .filter(entry -> tag_names.contains(entry.getKey())));
    }
15875
def tags(name = nil)
      list = stable_sort_by(@tags + convert_ref_tags, &:tag_name)
      return list unless name
      list.select {|tag| tag.tag_name.to_s == name.to_s }
    end
298018
public ListJobsRequest withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
133330
public void removeTag(String tagName) {
    int ids = -1;
    for (DataSet ds : iimFile.getDataSets()) {
      if (ds.getInfo().getName().equals(tagName))
        ids = ds.getInfo().getDataSetNumber();
    }
    if (ids != -1)
      iimFile.remove(ids);
  }
1052210
def set_tags(tag_list, options = {})
      options.reverse_merge! :context => nil, 
                             :tagger => nil, 
                             :downcase => true,
                             :delimiter => ','

      if block_given?
        tags = yield(klass)
      else
        tags = EasyTag::Tag.compact_tag_list(tag_list, options.slice(:downcase, :delimiter))
      end

      context = compact_context(options[:context])
      tagger = compact_tagger(options[:tagger])

      # Remove old tags
      self.taggings.where(:tag_context_id => context.try(:id), :tagger_id => tagger.try(:id)).destroy_all
      # TODO: should remove unused tags and contexts

      if tags
        tags.each do |t|
          tag = EasyTag::Tag.where(:name => t).first_or_create
          raise SimgleTag::InvalidTag if tag.nil?
          self.taggings.where(:tagger_id => tagger.try(:id), :tag_context_id => context.try(:id), :tag_id => tag.id).first_or_create
        end
      end
    end
535079
public TagProjectRequest withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
512747
public CreateRobotResult withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
520907
public function untag($tagNames=null)
    {
        if(is_null($tagNames)) {
            $tagNames = $this->tagNames();
        }

        $tagNames = static::$taggingUtility->makeTagArray($tagNames);

        foreach($tagNames as $tagName) {
            $this->removeTag($tagName);
        }

        if(static::shouldDeleteUnused()) {
            static::$taggingUtility->deleteUnusedTags();
        }
    }
1281870
public DescribeReservationResult withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
245009
public GetSubscriptionDefinitionResult withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
548043
public String[] tags(TagSet tagSet)
    {
        assert tagArray != null;

        String[] tags = new String[tagArray.length];
        for (int i = 0; i < tags.length; i++)
        {
            tags[i] = tagSet.stringOf(tagArray[i]);
        }

        return tags;
    }
883753
public MetadataBuilder setTags(List<String> tags)
    {
        if (tags == null)
            this.tags = new HashSet<>();
        else
            this.tags = Collections.unmodifiableSet(new HashSet<>(tags));

        return this;
    }
1236847
public void setTags(java.util.Collection<java.util.Map<String, String>> tags) {
        if (tags == null) {
            this.tags = null;
            return;
        }

        this.tags = new java.util.ArrayList<java.util.Map<String, String>>(tags);
    }
209614
public DescribeRobotResult withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
836742
public synchronized Filter addTags(String... tags) {
    for(String tag : tags) {
      this.tags.add(tag);
    }
    return this;
  }
266519
public static Tags of(@Nullable String... keyValues) {
        if (keyValues == null || keyValues.length == 0) {
            return empty();
        }
        if (keyValues.length % 2 == 1) {
            throw new IllegalArgumentException("size must be even, it is a set of key=value pairs");
        }
        Tag[] tags = new Tag[keyValues.length / 2];
        for (int i = 0; i < keyValues.length; i += 2) {
            tags[i / 2] = Tag.of(keyValues[i], keyValues[i + 1]);
        }
        return new Tags(tags);
    }
117232
public DescribeFleetResult withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }