code: def get_main_version(version):
      "Returns main version (X.Y[.Z]) from VERSION."
      parts = 2 if version[2] == 0 else 3
      return '.'.join(str(x) for x in version[:parts]f get_main_version(version):
      "Returns main version (X.Y[.Z]) from VERSION."
      parts = 2 if version[2] == 0 else 3
      return '.'.join(str(x) for x in version[:parts])
docs: Returns main version (X.Y[.Z]) from VERSION.