code: def write_version_py(source_root, filename="dipy/version.py"):
      cnt = """\
  # THIS FILE IS GENERATED DURING THE DIPY BUILD
  # See tools/version_utils.py for details
  
  short_version = '%(version)s'
  version = '%(version)s'
  full_version = '%(full_version)s'
  git_revision = '%(git_revision)s'
  commit_count = '%(commit_count)s'
  release = %(isrelease)s
  
  if not release:
      version = full_version
  """
      FULLVERSION, GIT_REVISION, COMMIT_COUNT = get_version_info(
          source_root
      )
  
      a = open(filename, "w")
      try:
          a.write(
              cnt
              % {
                  "version": VERSION,
                  "full_version": FULLVERSION,
                  "git_revision": GIT_REVISION,
                  "commit_count": COMMIT_COUNT,
                  "isrelease": str(ISRELEASED),
              }
          )
      finally:
          a.close()
  
imports: import os
  import subprocess
  import argparse
label_desc: Use image node_id 2 for calling a global function with example usage: write_version_py(source_root, filename) without return types