:param tag:
            Checks out specified tag. If set to ``None`` the latest
            tag will be checked out
        :returns:
            A list of all tags, sorted as version numbers, ascending
4290
def tag(self):
        '''
        
        '''

        tag = self.m(
            'getting git tags',
            cmdd=dict(
                cmd='git tag -l --sort="version:refname"',
                cwd=self.local
            ),
            verbose=False,
        )
        if tag.get('returncode') == 0:
            return tag.get('stdout')
709579
def _get_tag(repo, name):
    '''
    
    '''
    try:
        return [x for x in _all_tags(repo) if x[0] == name][0]
    except IndexError:
        return False
909792
def tag(self, tag):
        
        url = '%s/tags/%s' % (self, tag)
        response = self.http.get(url, auth=self.auth)
        response.raise_for_status()
        return response.json()
102633
def get_released_versions(component):
    

    releases = get_tags()
    releases = sorted([(x[0], [int(y) for y in x[1].split('.')]) for x in releases], key=lambda x: x[1])[::-1]

    return [(x[0], ".".join(map(str, x[1]))) for x in releases if x[0] == component]
650179
def ordered_tags(self):
        
        tags = list(self.tags.all())
        return sorted(
            tags,
            key=lambda tag: ((type(tag) != Tag) * 100000) + tag.count(),
            reverse=True
        )
113265
def view_all_tags(ctx, param, value):
    
    # To make sure this function executed only when the flag was called
    if not value or ctx.resilient_parsing:
        return
    avail_tags = dict()
    print("\nMultiQC Available module tag groups:\n")
    for mod_dict in filter(lambda mod:isinstance(mod, dict), config.module_order):
        mod_key, mod_val = list(mod_dict.items())[0]
        tags = list(mod_val.get('module_tag', []))
        for t in tags:
            if t not in avail_tags:
                avail_tags[t] = []
            avail_tags[t].append(mod_key)
    for t in sorted(avail_tags.keys(), key=lambda s: s.lower()):
        print (" - {}:".format(t))
        for ttgs in avail_tags[t]:
            print ("   - {}".format(ttgs))
    ctx.exit()
902627
def get_agent_tags(since, to):
    
    agent_tags = sorted(parse_version_info(t) for t in git_tag_list(r'^\d+\.\d+\.\d+$'))

    # default value for `to` is the latest tag
    if to:
        to = parse_version_info(to)
    else:
        to = agent_tags[-1]

    since = parse_version_info(since)

    # filter out versions according to the interval [since, to]
    agent_tags = [t for t in agent_tags if since <= t <= to]

    # reverse so we have descendant order
    return [str(t) for t in reversed(agent_tags)]
1040709
def tag_remove(self, *tags):
        
        return View({**self.spec, 'tag': list(set(self.tags) - set(tags))})
346480
def __git_tag(git_tag):
        
        command = ['git', 'tag', '-a', git_tag, '-m', '\'' + git_tag + '\'']
        Shell.msg('Create tag from version ' + git_tag)

        if APISettings.DEBUG:
            Git.__debug(command, False)

        if not call(command):
            return True
        return False
1105554
def do_update_tag
      # query latest count=1 log entry for latest revision; don't attempt to
      # specify revision on the assumption that the requested revision is
      # already checked out. the --revision argument appears to expect a
      # revision from-to range or else a start date or date range or else a
      # specific revision number. it prints nothing when HEAD is specified by
      # itself.
      @repository = @repository.clone
      svn_args = ['log', '--limit', '1']
      svn_client.output_for(svn_args).lines.each do |line|
        if matched = SVN_LOG_REGEX.match(line)
          @repository.tag = matched[1]
          break
        end
      end
    end
455832
def get_commit_from_tag(self, tag: str) -> Commit:
        
        try:
            selected_tag = self.repo.tags[tag]
            return self.get_commit(selected_tag.commit.hexsha)
        except (IndexError, AttributeError):
            logger.debug('Tag %s not found', tag)
            raise
635512
def _sane_version_list(version):
    
    v0 = str(version[0])
    if v0:
        # Test if the major is a number.
        try:
            v0 = v0.lstrip("v").lstrip("V")
            # Handle the common case where tags have v before major.
            v0 = int(v0)
        except ValueError:
            v0 = None

    if v0 is None:
        version = [0, 0] + version
    else:
        version[0] = v0

    try:
        # Test if the minor is a number.
        version[1] = int(version[1])
    except ValueError:
        # Insert Minor 0.
        version = [version[0], 0] + version[1:]

    return version
1164506
def last_git_release_tag(git_tags: str) -> str:
    
    semver_re = re.compile(r'[0-9]+\.[0-9]+\.[0-9]+$')
    str_ver = []
    for i in git_tags.split():
        if semver_re.search(i):
            str_ver.append(i)

    try:
        return str_ver[0]
    except IndexError:
        raise NoGitTagsException
613631
def sort_by_tag(self, tag):
        
        return AmpalContainer(sorted(self, key=lambda x: x.tags[tag]))
304639
def tag(self, *tags):
        
        if any([not isinstance(tag, collections.Hashable) for tag in tags]):
            raise TypeError('Every tag should be hashable')

        if not all(isinstance(tag, collections.Hashable) for tag in tags):
            raise TypeError('Tags must be hashable')
        self.tags.update(tags)
        return self
199980
def get_tags(self, rev=None):
		
		rev = rev or 'HEAD'
		return set(self._invoke('tag', '--points-at', rev).splitlines())
808451
def tag(self, tag):
        '''
        
        '''

        t = self.tag
        if t:
            if not tag:
                tag = t[-1]
            if tag in t:
                self._checkout(treeish=tag)