code: def info_packages() -> dict:
      """Get name and version of all installed packages."""
      packages = {}
      for dist in pkg_resources.working_set:
          package = dist.as_requirement()
          packages[package.key] = package.specs[0][1]
      return packages
  
file_path: pytorch-lightning/requirements/collect_env_details.py
imports: import os
  import platform
  import sys
  import pkg_resources
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: info_packages() and returns: packages