Parses a comma separated list of tag names.

@param tagNames a comma separated list of tag names.
@return the list of tag names.
340556
private static List<String> parseTagNames(String tagNames) {
    return Arrays.stream(tagNames.split("\\s*,\\s*"))
        .map(String::trim)
        .collect(Collectors.toList());
  }
1094183
public PostBuilder withTags(Term... tags) {
        return withTags(Arrays.stream(tags).map(Term::getId).collect(toList()));
    }
932817
protected List<Element> filterDescendants(Element parent, String[] tagNames)
    {
        List<Element> result = new ArrayList<Element>();
        for (String tagName : tagNames) {
            NodeList nodes = parent.getElementsByTagName(tagName);
            for (int i = 0; i < nodes.getLength(); i++) {
                Element element = (Element) nodes.item(i);
                result.add(element);
            }
        }
        return result;
    }
905005
public static Elements findElementsByTag(Element element, String ... tags) {
		List<Element> results = new ArrayList<Element>();
		
		Set<String> tagSet = new HashSet<String>();
		for(String tag : tags) 
			tagSet.add(tag.toLowerCase());
		filterElementsByTag(results, element, tagSet);
		return new Elements(results);
	}
	
	private static void filterElementsByTag(List<Element> results, Element element, Set<String> tagSet) {
		if(tagSet.contains(element.tag().getName().toLowerCase())) 
			results.add(element);
		
		for(Element child : element.children())
			filterElementsByTag(results, child, tagSet);
	}

	/** Returns the first element found with the given tag (or tag sequence separated by '/') or null. */
	public static Element findFirstByTag(Element element, String tag) {
		return findFirstByTag(element, tag.split("/"), 0);
	}
	
	private static Element findFirstByTag(Element current, String [] tags, int index) {
		if(index < tags.length) {
			Elements elements = current.getElementsByTag(tags[index]);
			for(Element element : elements) {
				Element result = findFirstByTag(element, tags, index + 1);
				if(result != null)
					return result;
			}
			return null;
		}
		else
			return current;
	}
    
}
807691
protected void parseNames() {
        while (reader.hasNextCharacter()) {
            final char character = next();
            if (Strings.isWhitespace(character)) {
                addName();
                continue;
            } else if (character == blockOpening) {
                addName();
                break;
            } else {
                builder.append(character);
            }
        }
        if (GdxArrays.isEmpty(tags)) {
            throwException("No tag names chosen.");
        }
    }
1289279
public ListDomainNamesResult withDomainNames(java.util.Map<String, String> domainNames) {
        setDomainNames(domainNames);
        return this;
    }
968892
public ApplicationResponse withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
894968
public function loadOrCreateTags($tagNames)
    {
        $tagNames = (is_array($tagNames)) ? $tagNames : $this->parseTagString($tagNames);

        $tags = [];
        foreach ($tagNames as $name) {
            if ($name) {
                $tags[] = $this->loadOrCreateTag($name);
            }
        }

        return $tags;
    }
986044
public final void setTags(Map<String, String> tags) {
        Map<String, String> updatedTags = new TreeMap<>();

        if (tags != null) {
            for (Map.Entry<String, String> entry : tags.entrySet()) {
                String key = entry.getKey();

                requireArgument(!Metric.ReservedField.isReservedField(key), MessageFormat.format("Tag {0} is a reserved tag name.", key));
                updatedTags.put(key, entry.getValue());
            }
        }
        _tags.clear();
        _tags.putAll(updatedTags);
    }
89555
public ListTagsForProjectResult withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
1298785
@SuppressWarnings("unchecked")
    public T addTags(List<String> tags) {
        if (this.tags_ == null) {
            tags_ = new ArrayList<>();
        }
        this.tags_.addAll(tags);
        return (T) this;
    }
217747
public void readTags(InputStream tagsXML)
    {
        SAXParserFactory factory = SAXParserFactory.newInstance();
        try
        {
            SAXParser saxParser = factory.newSAXParser();
            saxParser.parse(tagsXML, new TagsSaxHandler(this));
        }
        catch (ParserConfigurationException | SAXException | IOException ex)
        {
            throw new RuntimeException("Failed parsing the tags definition: " + ex.getMessage(), ex);
        }
    }
782651
@SuppressWarnings("unchecked")
	public T tags(final Collection<String> tags) {
		if (this.tags == null) {
			this.tags = new HashSet<>();
		}

		this.tags.addAll(tags);

		return (T) this;
	}
172939
@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
  public List<Filter> instanceTagNamesToFilters() {
    return tagsUtils.getAwsTagNames().map(Stream::of).orElseGet(Stream::empty)
        .map(tagNames -> new Tuple<>(tagNames, tagsUtils.getInstanceTags()))
        .flatMap(namesAndTags -> namesAndTags.getVal2()
            .stream()
            .filter(tag -> namesAndTags.getVal1().contains(tag.getKey())))
        .map(tag -> new Filter("tag:" + tag.getKey(), Collections.singletonList(tag.getValue())))
        .collect(Collectors.toList());
  }
388221
protected List<String> parseNameList( DdlTokenStream tokens ) throws ParsingException {
        List<String> names = new LinkedList<String>();

        while (true) {
            names.add(parseName(tokens));

            if (!tokens.canConsume(COMMA)) {
                break;
            }
        }

        return names;
    }
716318
public java.util.List<Tag> getTagsList() {
        if (tagsList == null) {
            tagsList = new com.amazonaws.internal.SdkInternalList<Tag>();
        }
        return tagsList;
    }
351661
function parseTags(tags) {
    if (tags.length > 0 && util.isArray(tags[0])) {
        tags = tags[0];
    }

    return tags;
}