code: def _find_packages(path):
      packages = {}
      try:
          filenames = os.listdir(path)
      except OSError:
          # Ignore: path doesn't exist or permission error
          filenames = ()
      # Make the code deterministic if a directory contains multiple wheel files
      # of the same package, but don't attempt to implement correct version
      # comparison since this case should not happen.
      filenames = sorted(filenames)
      for filename in filenames:
          # filename is like 'pip-21.2.4-py3-none-any.whl'
          if not filename.endswith(".whl"):
              continue
          for name in _PACKAGE_NAMES:
              prefix = name + "-"
              if filename.startswith(prefix):
                  break
          else:
              continue
  
          # Extract '21.2.4' from 'pip-21.2.4-py3-none-any.whl'
          version = filename.removeprefix(prefix).partition("-")[0]
          wheel_path = os.path.join(path, filename)
          packages[name] = _Package(version, None, wheel_path)
      return packages
  
file_path: catboost/contrib/tools/python3/src/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 1 for calling a global function with example usage: _find_packages(path) and returns: packages