code: def get_main_version(version=None):
      "Returns main version (X.Y[.Z]) from VERSION."
      version = get_complete_version(version)
      parts = 2 if version[2] == 0 else 3
      return ".".join(str(x) for x in version[:parts])
  
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 2 for calling a global function with example usage: get_main_version(version) and returns: str