code: def get_tf_version() -> str:
      # courtesy of huggingface/transformers
  
      _tf_version = ""
      _tf_available = importlib.util.find_spec("tensorflow") is not None
      if _tf_available:
          candidates = (
              "tensorflow",
              "tensorflow-cpu",
              "tensorflow-gpu",
              "tf-nightly",
              "tf-nightly-cpu",
              "tf-nightly-gpu",
              "intel-tensorflow",
              "intel-tensorflow-avx512",
              "tensorflow-rocm",
              "tensorflow-macos",
          )
          # For the metadata, we have to look for both tensorflow and tensorflow-cpu
          for pkg in candidates:
              try:
                  _tf_version = importlib.metadata.version(pkg)
                  break
              except importlib.metadata.PackageNotFoundError:
                  pass
      return _tf_version
  
imports: from __future__ import annotations
  import importlib.metadata
  import importlib.util
  import logging
  import typing
  from typing import TYPE_CHECKING
  from bentoml.exceptions import BentoMLException
  from ...types import LazyType
  from ...utils.lazy_loader import LazyLoader
label_desc: Use image node_id 3 for calling a global function with example usage: get_tf_version() and returns: _tf_version