code: def get_pkg_info(pkg_path: str) -> dict[str, str]:
      """Return dict describing the context of this package
  
      Parameters
      ----------
      pkg_path : str
         path containing __init__.py for package
  
      Returns
      -------
      context : dict
         with named parameters of interest
      """
      src, hsh = pkg_commit_hash(pkg_path)
      import numpy
  
      return dict(
          pkg_path=pkg_path,
          commit_source=src,
          commit_hash=hsh,
          sys_version=sys.version,
          sys_executable=sys.executable,
          sys_platform=sys.platform,
          np_version=numpy.__version__,
      )
  
file_path: nibabel/nibabel/pkg_info.py
imports: from __future__ import annotations
  import sys
  from contextlib import suppress
  from subprocess import run
  from packaging.version import Version
label_desc: Use image node_id 4 for calling a global function with example usage: get_pkg_info(pkg_path) and returns: dict