code: def is_gpu_available() -> bool:
      try:
          return len(tf.config.list_physical_devices("GPU")) > 0
      except AttributeError:
          return tf.test.is_gpu_available()
  
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 2 for calling a global function with example usage: is_gpu_available() and returns: unknown, tf