code: def _get_packages():
      global _PACKAGES, _WHEEL_PKG_DIR
      if _PACKAGES is not None:
          return _PACKAGES
  
      packages = {}
      for name, version, py_tag in _PROJECTS:
          wheel_name = f"{name}-{version}-{py_tag}-none-any.whl"
          packages[name] = _Package(version, wheel_name, None)
      if _WHEEL_PKG_DIR:
          dir_packages = _find_packages(_WHEEL_PKG_DIR)
          # only used the wheel package directory if all packages are found there
          if all(name in dir_packages for name in _PACKAGE_NAMES):
              packages = dir_packages
      _PACKAGES = packages
      return packages
  
file_path: cpython/Lib/ensurepip/__init__.py
imports: import collections
  import os
  import os.path
  import subprocess
  import sys
  import sysconfig
  import tempfile
  from importlib import resources
label_desc: Use image node_id 2 for calling a global function with example usage: _get_packages() and returns: packages, _PACKAGES