code: def _parse_version(version):
      match = re.match(
          r"(\d+)(?:\.(\d{1,2})(?:\.\d+)?)?((a|b|rc)\d)?$", version
      )
      if match is None:
          raise ValueError(
              "The given version is not in the right format. "
              'Use something like "3.8" or "3".'
          )
  
      major = int(match.group(1))
      minor = match.group(2)
      if minor is None:
          # Use the latest Python in case it's not exactly defined, because the
          # grammars are typically backwards compatible?
          if major == 2:
              minor = "7"
          elif major == 3:
              minor = "6"
          else:
              raise NotImplementedError(
                  "Sorry, no support yet for those fancy new/old versions."
              )
      minor = int(minor)
      return PythonVersionInfo(major, minor)
  
file_path: catboost/contrib/python/parso/py2/parso/utils.py
imports: from collections import namedtuple
  import re
  import sys
  from ast import literal_eval
  from functools import total_ordering
  from parso._compatibility import unicode
label_desc: Use image node_id 4 for calling a global function with example usage: _parse_version(version) and returns: PythonVersionInfo