code: def get_tagged_version_numbers(series='stable'):
      
      releases = []
      if series == 'testing':
          # Testing releases always have a hyphen after the version number:
          tag_regex = re.compile('^refs/tags/cassandra-([0-9]+\.[0-9]+\.[0-9]+-.*$)')
      else:
          # Stable and oldstable releases are just a number:
          tag_regex = re.compile('^refs/tags/cassandra-([0-9]+\.[0-9]+\.[0-9]+$)')
  
      tag_url = urllib.request.urlopen(GITHUB_TAGS)
      for ref in (i.get('ref', '') for i in json.loads(tag_url.read())):
          m = tag_regex.match(ref)
          if m:
              releases.append(LooseVersion(m.groups()[0]))
  
      # Sort by semver:
      releases.sort(reverse=True)
  
      stable_major_version = LooseVersion(str(releases[0].version[0]) + "." + str(releases[0].version[1]))
      stable_releases = [r for r in releases if r >= stable_major_version]
      oldstable_releases = [r for r in releases if r not in stable_releases]
      oldstable_major_version = LooseVersion(str(oldstable_releases[0].version[0]) + "." + str(oldstable_releases[0].version[1]))
      oldstable_releases = [r for r in oldstable_releases if r >= oldstable_major_version]
  
      if series == 'testing':
          return [r.vstring for r in releases]
      elif series == 'stable':
          return [r.vstring for r in stable_releases]
      elif series == 'oldstable':
          return [r.vstring for r in oldstable_releases]
      else:
          raise AssertionError("unknown release series: {series}".format(series=series))
docs: Retrieve git tags and find version numbers for a release series
  
      series - 'stable', 'oldstable', or 'testing