code: def add_git_version():
      def get_git_version():
          from subprocess import check_output
  
          try:
              return (
                  check_output(
                      "git describe --tags --long --dirty".split()
                  )
                  .decode("utf-8")
                  .strip()
              )
          except Exception:
              return __version__  # noqa
  
      newlibinfo_content = [
          l
          for l in libinfo_content
          if not l.startswith("__git_version__")
      ]
      newlibinfo_content.append(
          '__git_version__ = "{}"'.format(get_git_version())
      )
      with open(libinfo_py, "w") as f:
          f.write("".join(newlibinfo_content))
  
imports: from os import path
  import setuptools
  from setuptools import setup, find_packages
label_desc: Use image node_id 1 for calling a global function with example usage: add_git_version() and returns: check_output, __version__