code: def is_torch_available():
      _torch_available = importlib.util.find_spec("torch") is not None
      if _torch_available:
          try:
              importlib.metadata.version("torch")
          except importlib.metadata.PackageNotFoundError:
              _torch_available = False
      return _torch_available
  
file_path: BentoML/src/bentoml/_internal/frameworks/utils/transformers.py
imports: from __future__ import annotations
  import importlib.metadata
  import importlib.util
  import logging
  import re
  import typing
  from contextlib import contextmanager
  from pathlib import Path
  import torch
  import torch.nn
  from packaging import version
label_desc: Use image node_id 2 for calling a global function with example usage: is_torch_available() and returns: _torch_available