code: def get_current_semver_version():
      """Returns a Version object of current version.
  
      Returns:
        version: Version object of current SemVer string based on information from
        core/public/version.h
      """
  
      # Get current version information.
      version_file = open(VERSION_H, "r")
      for line in version_file:
          major_match = re.search(
              "^#define TF_MAJOR_VERSION ([0-9]+)", line
          )
          minor_match = re.search(
              "^#define TF_MINOR_VERSION ([0-9]+)", line
          )
          patch_match = re.search(
              "^#define TF_PATCH_VERSION ([0-9]+)", line
          )
          extension_match = re.search(
              '^#define TF_VERSION_SUFFIX "(.*)"', line
          )
          if major_match:
              old_major = major_match.group(1)
          if minor_match:
              old_minor = minor_match.group(1)
          if patch_match:
              old_patch_num = patch_match.group(1)
          if extension_match:
              old_extension = extension_match.group(1)
              break
  
      if "dev" in old_extension:
          version_type = NIGHTLY_VERSION
      else:
          version_type = REGULAR_VERSION
  
      return Version(
          old_major,
          old_minor,
          old_patch_num,
          old_extension,
          version_type,
      )
  
imports: import argparse
  import os
  import re
  import subprocess
  import time
label_desc: Use image node_id 4 for calling a global function with example usage: get_current_semver_version() and returns: Version