code: def is_installed(name: str) -> bool:
      """
      Return whether a package is installed.
  
      :param name:
          the package's name
  
      :return:
          whether the package can be imported
      """
      try:
          importlib.import_module(name=name)
      except ImportError:
          return False
      return True
  
imports: import importlib
  import unittest
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: is_installed(name) and returns: True, False