code: def git_version():
      cmd = [_git_exe.read(), "--version"]
      try:
          out = subprocess.check_output(cmd).decode().strip()
      except (FileNotFoundError, subprocess.CalledProcessError) as e:
          if log.getEffectiveLevel() <= logging.DEBUG:
              log.exception("error getting git version")
          raise GitNotInstalled() from e
      else:
          m = re.search(r"([0-9]+)\.([0-9]+)\.([0-9]+)", out)
          assert m and m.lastindex == 3, out
          return tuple(int(x) for x in m.groups())
  
imports: import collections
  import logging
  import re
  import os
  import subprocess
  from guild import config
  from guild import file_util
  from guild import util
  from guild.file_util import FileSelectRule
label_desc: Use image node_id 31 for calling a global function with example usage: git_version() and returns: tuple