Fetch the commit hash that was tagged with ``tag_name``.

        Args:
            tag_name (str): the name of the tag

        Returns:
            str: the commit hash linked by the tag
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
168516
def lookup_tag_due_date
      config.fetch(:tags).fetch(match[:tag])
    rescue KeyError
      msg = "#{match[:tag]} tag not defined in config file"
      raise KeyError, msg
    end
1257078
def get_id_by_name(tag_name, kind='z'):
        '''
        
        '''
        recs = TabTag.select().where(
            (TabTag.name == tag_name) & (TabTag.kind == kind)
        )
        logger.info('tag count of {0}: {1} '.format(tag_name, recs.count()))
        # the_id = ''
        if recs.count() == 1:
            the_id = recs.get().uid
        elif recs.count() > 1:
            rec0 = None
            for rec in recs:
                # Only keep one.
                if rec0:
                    TabPost2Tag.delete().where(TabPost2Tag.tag_id == rec.uid).execute()
                    TabTag.delete().where(TabTag.uid == rec.uid).execute()
                else:
                    rec0 = rec

            the_id = rec0.uid
        else:
            the_id = MLabel.create_tag(tag_name)
        return the_id
23442
def delete_tag(self, tag_name, **kwargs):
        
        resp = self._delete(self._u(self._TAG_ENDPOINT_SUFFIX, tag_name),
                            **kwargs)
        resp.raise_for_status()
        # successful delete returns 204, which has no associated json
        return resp
504977
def tag_implications(self, name_matches=None, antecedent_name=None,
                         tag_id=None):
        
        params = {
            'search[name_matches]': name_matches,
            'search[antecedent_name]': antecedent_name,
            'search[id]': tag_id
            }
        return self._get('tag_implications.json', params)
1166084
def get_current_tag(self) -> typing.Optional[str]:
        
        tags = list(self.repo.tags)
        if not tags:
            LOGGER.debug('no tag found')
            return None
        for tag in tags:
            LOGGER.debug('tag found: %s; comparing with commit', tag)
            if tag.commit == self.latest_commit():
                tag_name: str = tag.name
                LOGGER.debug('found tag on commit: %s', tag_name)
                return tag_name

        LOGGER.debug('no tag found on latest commit')
        return None
1137067
def get_tags(self, name):
        
        tags = list()
        for tag in self._tags:
            if tag[0] == name:
                tags.append(tag[1])

        return tags
1299441
def git_tag_to_semver(git_tag: str) -> SemVer:
    
    pattern = re.compile(r'[0-9]+\.[0-9]+\.[0-9]+$')
    match = pattern.search(git_tag)
    if match:
        version = match.group(0)
    else:
        raise InvalidTagFormatException('Tag passed contains no SemVer.')

    return SemVer.from_str(version)
970552
async function getTagCommit(githubRepo, tag) {
  const cachedResult = await renovateCache.get(
    cacheNamespace,
    getCacheKey(githubRepo, `tag-${tag}`)
  );
  // istanbul ignore if
  if (cachedResult) {
    return cachedResult;
  }
  let digest;
  try {
    const url = `https://api.github.com/repos/${githubRepo}/git/refs/tags/${tag}`;
    digest = (await ghGot(url)).body.object.sha;
  } catch (err) {
    logger.info(
      { githubRepo, err },
      'Error getting tag commit from GitHub repo'
    );
  }
  if (!digest) {
    return null;
  }
  const cacheMinutes = 120;
  await renovateCache.set(
    cacheNamespace,
    getCacheKey(githubRepo, `tag-${tag}`),
    digest,
    cacheMinutes
  );
  return digest;
}
206594
def update_tag(self, tag_id, tag_name):
        
        return self.post(
            url="https://api.weixin.qq.com/cgi-bin/tags/update",
            data={"tag": {
                "id": tag_id,
                "name": tag_name
            }}
        )
526917
def search_tags(self, tag_name):

        

        response = self._req('/browse/tags/search', {
            "tag_name":tag_name
        })

        tags = list()

        for item in response['results']:
            tags.append(item['tag_name'])

        return tags
824587
def untag(name, tag_name):
    

    with LOCK:
        by_tag = TAGS.get(tag_name, None)
        if not by_tag:
            return False
        try:
            by_tag.remove(name)

            # remove the tag if no associations left
            if not by_tag:
                TAGS.pop(tag_name)

            return True
        except KeyError:
            return False
893502
def get_tagged_version(self):
		
		tags = list(self.get_tags())
		if 'tip' in tags and not self.is_modified():
			tags = self.get_parent_tags('tip')
		versions = self.__versions_from_tags(tags)
		return self.__best_version(versions)
692505
def _get_version_from_git_tag(path):
    
    m = GIT_DESCRIBE_REGEX.match(_git_describe_tags(path) or '')
    if m is None:
        return None
    version, post_commit, hash = m.groups()
    return version if post_commit == '0' else "{0}.post{1}+{2}".format(version, post_commit, hash)
641702
def re_tag(name, remote=False, commit=None):
    
    if remote:
        tags = run('ls-remote --tags', quiet=True).splitlines()
        if name in tags:
            hide(name)
    if is_tag(name):
        run('tag --delete %s' % name)
    return tag(name, remote, commit)
46448
def get_version_from_tag(tag_name: str) -> Optional[str]:
    

    debug('get_version_from_tag({})'.format(tag_name))
    check_repo()
    for i in repo.tags:
        if i.name == tag_name:
            return i.commit.hexsha
    return None
1236405
def get_tag(self, tagname, tagidx):
        
        return '%s=%s' % (tagname, decode(getattr(self, tagname)[tagidx]))