def get_sorted_tags(self, pattern):
        """
        pattern - for production: r'^v(\d+)\.(\d+)\.(\d+)\.0'

        all groups from pattern will be converted to integers, and tags will be compared using the resulting tuple
        """
        matcher = re.compile(pattern)
        tags = []
        for tag in self.get_repo().git.tag().split('\n'):
            m = matcher.match(tag)
            if m:
                numbers = []
                for k, v in m.groupdict().items():
                    if k.startswith('cmp'):
                        numbers.append((int(k[3:]), int(v)))
                numbers.sort()

                tags.append((tag, numbers))
        return map(lambda t: t[0], sorted(tags, key=lambda t: t[1], reverse=True))
def get_sorted_tags ( self , pattern ) : matcher = re . compile ( pattern ) tags = [ ] for tag in self . get_repo ( ) . git . tag ( ) . split ( '\n' ) : m = matcher . match ( tag ) if m : numbers = [ ] for k , v in m . groupdict ( ) . items ( ) : if k . startswith ( 'cmp' ) : numbers . append ( ( int ( k [ 3 : ] ) , int ( v ) ) ) numbers . sort ( ) tags . append ( ( tag , numbers ) ) return map ( lambda t : t [ 0 ] , sorted ( tags , key = lambda t : t [ 1 ] , reverse = True ) )
pattern - for production: r'^v(\d+)\.(\d+)\.(\d+)\.0'

        all groups from pattern will be converted to integers, and tags will be compared using the resulting tuple