code: def git_version(version):
      # Append last commit date and hash to dev version information,
      # if available
  
      import subprocess
      import os.path
  
      git_hash = ""
      try:
          p = subprocess.Popen(
              ["git", "log", "-1", '--format="%H %aI"'],
              stdout=subprocess.PIPE,
              stderr=subprocess.PIPE,
              cwd=os.path.dirname(__file__),
          )
      except FileNotFoundError:
          pass
      else:
          out, err = p.communicate()
          if p.returncode == 0:
              git_hash, git_date = (
                  out.decode("utf-8")
                  .strip()
                  .replace('"', "")
                  .split("T")[0]
                  .replace("-", "")
                  .split()
              )
  
              # Only attach git tag to development versions
              if "dev" in version:
                  version += f"+git{git_date}.{git_hash[:7]}"
  
      return version, git_hash
  
imports: import os
  import textwrap
label_desc: Use image node_id 2 for calling a global function with example usage: git_version(version) and returns: version,  git_hash