parameters: ()
docstring: Function generates version like in cmake
      custom_{branch_name}_{commit_hash}
docstring_summary: Function generates version like in cmake
      custom_{branch_name}_{commit_hash}
docstring_tokens: Function generates version like in cmake custom_ { branch_name } _ { commit_hash }
function: def generate_mo_version():
      """
      Function generates version like in cmake
      custom_{branch_name}_{commit_hash}
      """
      try:
          mo_dir = get_mo_root_dir()
          branch_name = subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"], cwd=mo_dir).strip().decode()
          commit_hash = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=mo_dir).strip().decode()
          return "{}.custom_{}_{}".format(mo_major_and_minor_version, branch_name, commit_hash)
      except Exception as e:
          return "unknown version"
function_tokens: def generate_mo_version ( ) : try : mo_dir = get_mo_root_dir ( ) branch_name = subprocess . check_output ( [ "git" , "rev-parse" , "--abbrev-ref" , "HEAD" ] , cwd = mo_dir ) . strip ( ) . decode ( ) commit_hash = subprocess . check_output ( [ "git" , "rev-parse" , "HEAD" ] , cwd = mo_dir ) . strip ( ) . decode ( ) return "{}.custom_{}_{}" . format ( mo_major_and_minor_version , branch_name , commit_hash ) except Exception as e : return "unknown version"