code: def get_version(version=None):
      "Returns a PEP 440-compliant version number from VERSION."
      version = get_complete_version(version)
  
      # Now build the two parts of the version number:
      # main = X.Y[.Z]
      # sub = .devN - for pre-alpha releases
      #     | {a|b|rc}N - for alpha, beta, and rc releases
  
      main = get_main_version(version)
  
      sub = ""
      if version[3] == "alpha" and version[4] == 0:
          git_changeset = get_git_changeset()
          if git_changeset:
              sub = ".dev%s" % git_changeset
          else:
              sub = ".dev"
      elif version[3] != "final":
          mapping = {"alpha": "a", "beta": "b", "rc": "rc"}
          sub = mapping[version[3]] + str(version[4])
  
      return str(main + sub)
  
file_path: wandb/wandb/vendor/graphql-core-1.1/wandb_graphql/pyutils/version.py
imports: from __future__ import unicode_literals
  import datetime
  import os
  import subprocess
label_desc: Use image node_id 1 for calling a global function with example usage: get_version(version) and returns: str