code: def _get_dependency_versions(package):
      """Retrieve direct dependency of the given package
  
      Args:
          package (str): name of the package
      """
      # Get all requires for the package
      dependencies = distribution(package).requires
      # Filter-out test dependencies
      dependencies = [
          req
          for req in dependencies
          if not bool(re.search("extra.*test", req))
      ]
      # keep only package name
      dependencies = [
          re.findall("[a-zA-Z0-9_\\-]+", req)[0].strip()
          for req in dependencies
      ]
      versions = dict()
      for dependency in dependencies:
          try:
              versions[dependency] = version(dependency)
          except ImportError:
              versions[dependency] = None
      return versions
  
file_path: autogluon/core/src/autogluon/core/utils/version_utils.py
imports: import pkgutil
  import platform
  import re
  import sys
  from datetime import datetime
  from importlib.metadata import distribution, version
  import autogluon
  from autogluon.common.utils.nvutil import cudaInit, cudaSystemGetNVMLVersion
  from autogluon.common.utils.resource_utils import ResourceManager
label_desc: Use image node_id 2 for calling a global function with example usage: _get_dependency_versions(package) and returns: versions