code: def get_image_version(version_str: str = version.__version__) -> str:
      """Gets the version for image tag based on SDK version.
  
      Args:
        version_str: The SDK version.
  
      Returns:
        Version string representing the image version should be used. For offcially
        released version of TFX SDK, we'll align the SDK and the image versions; For
        'dev' or customized versions we'll use the latest image version.
      """
      if _REGULAR_NIGHTLY_VERSION_PATTERN.fullmatch(version_str):
          # This SDK is a released version.
          return version_str
      elif _RC_VERSION_PATTERN.fullmatch(version_str):
          # For RC versions the hiphen needs to be removed.
          return version_str.replace("-", "")
  
      logging.info(
          "custom/dev SDK version detected: %s, using latest image "
          "version",
          version_str,
      )
      return "latest"
  
imports: import re
  from absl import logging
  from tfx import version
label_desc: Use image node_id 1 for calling a global function with example usage: get_image_version(version_str) and returns: str, version_str, version_str