Information of existing tags.
@param  {string} newTag  Tag.
@return {array}          Full info of tags and the first commit.
973782
function gitTagsInfo(newTag) {
  const date = new Date().toISOString();

  return Promise.all([
    git('git tag -l', stdout => {
      const allTags = stdout
        .toString()
        .trim()
        .split('\n')
        .sort((a, b) => {
          if (Semver.lt(a, b)) return -1;
          if (Semver.gt(a, b)) return 1;
          return 0;
        });

      return allTags;
    })
      .then(infoOfTags => {
        const tagsHolder = {};
        let currentMajor = 1;
        let nextMajor = 2;
        let groups = [];

        infoOfTags.push(newTag);

        infoOfTags.forEach((tag, idx) => {
          groups.push({
            tag,
            date: tag === newTag ? date.substring(0, date.indexOf('T')) : gitDateOf(tag)
          });

          if (Semver.valid(infoOfTags[idx + 1])) {
            if (Semver.major(infoOfTags[idx + 1]) === nextMajor) {
              tagsHolder[`v${currentMajor}`] = groups;

              currentMajor += 1;
              nextMajor += 1;
              groups = [];
            }
          } else {
            tagsHolder[`v${currentMajor}`] = groups;
          }
        });

        return tagsHolder;
      })
      .catch(log.error),

    git('rev-list HEAD | tail -n 1')
  ]);
}
1353867
public static String getOpeningTag(String tag, Map<String, String> attributes)
	{
		StringBuffer _result = new StringBuffer();
		Map<String, String> _attributes = (null != attributes) ? attributes : EMPTY_MAP;
		return doAppendOpeningTag(_result, tag, _attributes).toString();
	}
1039373
private ImmutableMap<String, String> initCustomTagsMap(ImmutableMap<String, String> tags) {
		return ImmutableMap.copyOf(firstNonNull(tags, Collections.<String, String>emptyMap()));
	}
675046
function parseAllTags(buf) {
  var result = [];
  var element;
  
  while (buf.length > 0) {
    element = parseTag(buf);
    buf = buf.slice(element.length);
    result.push(element.tag);
  }
  
  return result;
}
656384
def find_tag_info(tag_info, dictionary)
      ti = {}
      ti[:errors] = []
      ti[:complete_match] = tag_info[0]
      ti[:is_tag] = (tag_info[0].start_with? '[')
      if ti[:is_tag]
        ti[:closing_tag] = (tag_info[2] == '/')
        ti[:tag] = tag_info[3].to_sym.downcase
        ti[:params] = {}
        @definition = dictionary[ti[:tag]]
        if tag_info[5][0] == ?= and can_have_quick_param?
          quick_param = tag_info[5][1..-1]
          # Get list of parameter values and add them as (regular) parameters
          value_array = quick_param.scan(@definition[:quick_param_format])[0]
          if value_array.nil?
            ti[:invalid_quick_param] = quick_param
          else
            param_tokens = @definition[:param_tokens]
            value_array[0..param_tokens.length - 1].each.with_index do |value, i|
              ti[:params][param_tokens[i][:token]] = value
            end
          end
        elsif tag_info[5][0] == ?\s
          regex_string = '((\w+)=([\w#]+)) | ((\w+)="([^"]+)") | ((\w+)=\'([^\']+)\')'
          tag_info[5].scan(/#{regex_string}/ix) do |param_info|
            param = param_info[1] || param_info[4] || param_info[7]
            value = param_info[2] || param_info[5] || param_info[8]
            ti[:params][param.to_sym] = value
          end
        end
      else
        # Plain text
        ti[:text] = tag_info[9]
      end
      ti
    end
420555
function parseTagged(definition, taggedTypes) {
	let match = definition.match(/^(\w+)(?:\((.*)\))?$/),
		tag, args, typeInfo
	if (!match) {
		return
	}

	// Get type info
	tag = match[1]
	typeInfo = taggedTypes[tag]
	if (!typeInfo) {
		return
	}

	// Special no-'()' case: only match 'tag' if minArgs is zero
	if (typeInfo.minArgs > 0 && match[2] === undefined) {
		return
	}

	// Parse and check args
	args = (match[2] || '').trim().split(/\s*,\s*/)
	if (args.length === 1 && args[0] === '') {
		// Especial empty case
		args = []
	}
	args = args.map((arg, i) => {
		if (!arg) {
			if (!typeInfo.sparse) {
				throw new Error('Missing argument at position ' + i + ' for tagged type ' + tag)
			}
			return
		}

		if (typeInfo.numeric) {
			arg = Number(arg)
			if (isNaN(arg)) {
				throw new Error('Invalid numeric argument at position ' + i + ' for tagged type ' + tag)
			}
		}

		return arg
	})
	args.original = definition
	if (args.length < typeInfo.minArgs) {
		throw new Error('Too few arguments for tagged type ' + tag)
	} else if (typeInfo.maxArgs && args.length > typeInfo.maxArgs) {
		throw new Error('Too many arguments for tagged type ' + tag)
	}

	return new Field(typeInfo.type, typeInfo.parseArgs ? typeInfo.parseArgs(args) : args)
}
710448
function getImmediateCustomParentTag(tag) {
  var ptag = tag
  while (!getTag(ptag.root)) {
    if (!ptag.parent) break
    ptag = ptag.parent
  }
  return ptag
}
513276
function getTag(el) {
    return (el.firstChild === null) ? {'UL':'LI','DL':'DT','TR':'TD'}[el.tagName] || el.tagName : el.firstChild.tagName;
}
794147
function () {
    var text = '[' + this.tag

    _.each(this.attrs.numeric, function (value) {
      if (/\s/.test(value)) {
        text += ' "' + value + '"'
      } else {
        text += ' ' + value
      }
    })

    _.each(this.attrs.named, function (value, name) {
      text += ' ' + name + '="' + value + '"'
    })

    // If the tag is marked as `single` or `self-closing`, close the
    // tag and ignore any additional content.
    if (this.type === 'single') {
      return text + ']'
    } else if (this.type === 'self-closing') {
      return text + ' /]'
    }

    // Complete the opening tag.
    text += ']'

    if (this.content) {
      text += this.content
    }

    // Add the closing tag.
    return text + '[/' + this.tag + ']'
  }
635922
def tagged(self, tag, offset=0, count=25):
        ''''''
        return json.loads(self.client('tag', 'get', tag, offset, count))
136191
func NewTag(tag string) Tag {
	var t Tag
	if copy(t[:], tag) != 2 {
		panic("sam: illegal tag length")
	}
	return t
}
611435
function(tag, attribs, contents, selfclosing) {
  var result = '<' + tag;
  if (attribs) {
    var i = 0;
    var attrib;
    while ((attrib = attribs[i]) !== undefined) {
      result = result.concat(' ', attrib[0], '="', attrib[1], '"');
      i++;
    }
  }
  if (contents) {
    result = result.concat('>', contents, '</', tag, '>');
  } else if (selfclosing) {
    result = result + ' />';
  } else {
    result = result.concat('></', tag, '>');
  }
  return result;
}
734599
def all_with_tags(*tags)
      return [] if tags.empty?
      select do |project|
        tags.map(&:to_sym).all? { |tag| project.all_tags.include?(tag) }
      end
    end
45230
def _prep_tags(t, annotations):
    """"""
    tags = [['O' for _ in sent.tokens] for sent in t.sentences]
    for start, end, text in annotations:
        done_first = False
        for i, sent in enumerate(t.sentences):
            for j, token in enumerate(sent.tokens):
                if start <= token.start < end or start < token.end <= end:
                    # Token start or end occurs within the annotation
                    tags[i][j] = 'I-CM' if done_first else 'B-CM'
                    done_first = True
    tagged = [[(token[0], token[1], tags[i][j]) for j, token in enumerate(sentence.pos_tagged_tokens)] for i, sentence in enumerate(t.sentences)]
    return tagged
281077
function getTag(entry, tagName) {
  var parsed = entry.parsed;
  return _.find(parsed.tags, ['title', tagName]) || null;
}
708832
function(tag) {
		if (!tag) {
			// create a document fragment to hold multiple-root elements
			if (document.createDocumentFragment) {
				return document.createDocumentFragment();
			}

			tag = '';

		} else if (tag.charAt(0) === '!') {
			return document.createComment(tag === '!' ? '' : tag.substr(1)+' ');
		}

		return document.createElement(tag);
	}
429509
public static Tag newTag(String key, String value) {
    Tag newTag = new BasicTag(intern(key), intern(value));
    return intern(newTag);
  }