code: def write_version_info(filename, git_version):
      """Write a c file that defines the version functions.
  
      Args:
        filename: filename to write to.
        git_version: the result of a git describe.
      """
      if b'"' in git_version or b"\\" in git_version:
          git_version = (
              b"git_version_is_invalid"  # do not cause build to fail!
          )
      contents = """
  /*  Generated by gen_git_source.py  */
  
  #ifndef TENSORFLOW_CORE_UTIL_VERSION_INFO_H_
  #define TENSORFLOW_CORE_UTIL_VERSION_INFO_H_
  
  #define STRINGIFY(x) #x
  #define TOSTRING(x) STRINGIFY(x)
  
  #define TF_GIT_VERSION "%s"
  #ifdef _MSC_VER
  #define TF_COMPILER_VERSION "MSVC " TOSTRING(_MSC_FULL_VER)
  #else
  #define TF_COMPILER_VERSION __VERSION__
  #endif
  #ifdef _GLIBCXX_USE_CXX11_ABI
  #define TF_CXX11_ABI_FLAG _GLIBCXX_USE_CXX11_ABI
  #else
  #define TF_CXX11_ABI_FLAG 0
  #endif
  #define TF_CXX_VERSION __cplusplus
  #ifdef TENSORFLOW_MONOLITHIC_BUILD
  #define TF_MONOLITHIC_BUILD 1
  #else
  #define TF_MONOLITHIC_BUILD 0
  #endif
  
  #endif  // TENSORFLOW_CORE_UTIL_VERSION_INFO_H_
  """ % git_version.decode(
          "utf-8"
      )
      open(filename, "w").write(contents)
  
file_path: tensorflow-upstream/tensorflow/tools/git/gen_git_source.py
imports: import argparse
  from builtins import bytes
  import json
  import os
  import shutil
  import subprocess
label_desc: Use image node_id 4 for calling a global function with example usage: write_version_info(filename, git_version) without return types