code: def get_package_info(path: str) -> PackageInfo:
      try:
          prev = os.getcwd()
          path = os.path.abspath(path)
          os.chdir(path)
          out, _err = run_python_script(
              cmd=[f"{path}/setup.py", "--version"], allow_warnings=True
          )
          local_version: Version = parse_version(out)
          package_name, _err = run_python_script(
              cmd=[f"{path}/setup.py", "--name"], allow_warnings=True
          )
      finally:
          os.chdir(prev)
  
      remote_metadata = get_metadata(package_name)
      latest = get_releases(remote_metadata)[-1]
      return PackageInfo(
          name=package_name,
          local_version=local_version,
          latest_version=latest,
      )
  
imports: import logging
  import os
  import re
  import shutil
  from dataclasses import dataclass
  from enum import Enum
  from functools import lru_cache
  from pathlib import Path
  from typing import Dict, List, Tuple
  import hydra
  import requests
  from hydra.core.config_store import ConfigStore
  from hydra.test_utils.test_utils import find_parent_dir_containing, run_python_script
  from omegaconf import II, MISSING, SI, DictConfig, OmegaConf
  from packaging.version import Version, parse
label_desc: Use image node_id 4 for calling a global function with example usage: get_package_info(path) and returns: PackageInfo