code: def is_installed(package):
      try:
          dist = importlib.metadata.distribution(package)
      except importlib.metadata.PackageNotFoundError:
          try:
              spec = importlib.util.find_spec(package)
          except ModuleNotFoundError:
              return False
  
          return spec is not None
  
      return dist is not None
  
imports: import logging
  import re
  import subprocess
  import os
  import shutil
  import sys
  import importlib.util
  import importlib.metadata
  import platform
  import json
  from functools import lru_cache
  from modules import cmd_args, errors
  from modules.paths_internal import script_path, extensions_dir
  from modules.timer import startup_timer
  from modules import logging_config
label_desc: Use image node_id 5 for calling a global function with example usage: is_installed(package) and returns: unknown, unknown, False