parameters: (filename, git_version)
docstring: Write a c file that defines the version functions.
  
    Args:
      filename: filename to write to.
      git_version: the result of a git describe.
docstring_summary: Write a c file that defines the version functions.
docstring_tokens: Write a c file that defines the version functions .
function: 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  */
  #include <string>
  const char* tf_git_version() {return "%s";}
  const char* tf_compiler_version() {
  #ifdef _MSC_VER
  #define STRINGIFY(x) #x
  #define TOSTRING(x) STRINGIFY(x)
    return "MSVC " TOSTRING(_MSC_FULL_VER);
  #else
    return __VERSION__;
  #endif
  }
  int tf_cxx11_abi_flag() {
  #ifdef _GLIBCXX_USE_CXX11_ABI
    return _GLIBCXX_USE_CXX11_ABI;
  #else
    return 0;
  #endif
  }
  int tf_monolithic_build() {
  #ifdef TENSORFLOW_MONOLITHIC_BUILD
    return 1;
  #else
    return 0;
  #endif
  }
  """ % git_version.decode("utf-8")
    open(filename, "w").write(contents)
function_tokens: def write_version_info ( filename , git_version ) : 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  */
  #include <string>
  const char* tf_git_version() {return "%s";}
  const char* tf_compiler_version() {
  #ifdef _MSC_VER
  #define STRINGIFY(x) #x
  #define TOSTRING(x) STRINGIFY(x)
    return "MSVC " TOSTRING(_MSC_FULL_VER);
  #else
    return __VERSION__;
  #endif
  }
  int tf_cxx11_abi_flag() {
  #ifdef _GLIBCXX_USE_CXX11_ABI
    return _GLIBCXX_USE_CXX11_ABI;
  #else
    return 0;
  #endif
  }
  int tf_monolithic_build() {
  #ifdef TENSORFLOW_MONOLITHIC_BUILD
    return 1;
  #else
    return 0;
  #endif
  }
  """ % git_version . decode ( "utf-8" ) open ( filename , "w" ) . write ( contents )